pub struct WorktreeAddOptions<'a> { /* private fields */ }
Expand description
Options which can be used to configure how a worktree is initialized
Implementations§
Source§impl<'a> WorktreeAddOptions<'a>
impl<'a> WorktreeAddOptions<'a>
Sourcepub fn new() -> WorktreeAddOptions<'a>
pub fn new() -> WorktreeAddOptions<'a>
Creates a default set of add options.
By default this will not lock the worktree
Sourcepub fn lock(&mut self, enabled: bool) -> &mut WorktreeAddOptions<'a>
pub fn lock(&mut self, enabled: bool) -> &mut WorktreeAddOptions<'a>
If enabled, this will cause the newly added worktree to be locked
Sourcepub fn checkout_existing(
&mut self,
enabled: bool,
) -> &mut WorktreeAddOptions<'a>
pub fn checkout_existing( &mut self, enabled: bool, ) -> &mut WorktreeAddOptions<'a>
If enabled, this will checkout the existing branch matching the worktree name.
Sourcepub fn reference(
&mut self,
reference: Option<&'a Reference<'_>>,
) -> &mut WorktreeAddOptions<'a>
pub fn reference( &mut self, reference: Option<&'a Reference<'_>>, ) -> &mut WorktreeAddOptions<'a>
reference to use for the new worktree HEAD
Sourcepub fn raw(&self) -> *const git_worktree_add_options
pub fn raw(&self) -> *const git_worktree_add_options
Get a set of raw add options to be used with git_worktree_add
Auto Trait Implementations§
impl<'a> Freeze for WorktreeAddOptions<'a>
impl<'a> RefUnwindSafe for WorktreeAddOptions<'a>
impl<'a> !Send for WorktreeAddOptions<'a>
impl<'a> !Sync for WorktreeAddOptions<'a>
impl<'a> Unpin for WorktreeAddOptions<'a>
impl<'a> UnwindSafe for WorktreeAddOptions<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more