File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1977,6 +1977,7 @@ git_enum! {
1977
1977
pub struct git_worktree_add_options {
1978
1978
pub version : c_uint ,
1979
1979
pub lock : c_int ,
1980
+ pub checkout_existing : c_int ,
1980
1981
pub reference : * mut git_reference ,
1981
1982
pub checkout_options : git_checkout_options ,
1982
1983
}
Original file line number Diff line number Diff line change @@ -165,6 +165,12 @@ impl<'a> WorktreeAddOptions<'a> {
165
165
self
166
166
}
167
167
168
+ /// If enabled, this will checkout the existing branch matching the worktree name.
169
+ pub fn checkout_existing ( & mut self , enabled : bool ) -> & mut WorktreeAddOptions < ' a > {
170
+ self . raw . checkout_existing = enabled as c_int ;
171
+ self
172
+ }
173
+
168
174
/// reference to use for the new worktree HEAD
169
175
pub fn reference (
170
176
& mut self ,
You can’t perform that action at this time.
0 commit comments