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! {
19771977pub struct git_worktree_add_options {
19781978 pub version : c_uint ,
19791979 pub lock : c_int ,
1980+ pub checkout_existing : c_int ,
19801981 pub reference : * mut git_reference ,
19811982 pub checkout_options : git_checkout_options ,
19821983}
Original file line number Diff line number Diff line change @@ -165,6 +165,12 @@ impl<'a> WorktreeAddOptions<'a> {
165165 self
166166 }
167167
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+
168174 /// reference to use for the new worktree HEAD
169175 pub fn reference (
170176 & mut self ,
You can’t perform that action at this time.
0 commit comments