We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
git_worktree_add_options
1 parent 8b5fba7 commit c074cabCopy full SHA for c074cab
libgit2-sys/lib.rs
@@ -1977,6 +1977,7 @@ git_enum! {
1977
pub struct git_worktree_add_options {
1978
pub version: c_uint,
1979
pub lock: c_int,
1980
+ pub checkout_existing: c_int,
1981
pub reference: *mut git_reference,
1982
pub checkout_options: git_checkout_options,
1983
}
src/worktree.rs
@@ -165,6 +165,12 @@ impl<'a> WorktreeAddOptions<'a> {
165
self
166
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
+
174
/// reference to use for the new worktree HEAD
175
pub fn reference(
176
&mut self,
0 commit comments