pub struct WorktreeCreateOpts {
pub branch: String,
pub path: PathBuf,
pub start_point: Option<String>,
pub force_branch: bool,
pub detach: bool,
}Expand description
Options for creating a new worktree.
Fields§
§branch: StringBranch name to create (or check out if it already exists).
path: PathBufTarget path for the new worktree. Can be absolute or relative to the repository root.
start_point: Option<String>Starting point for the new branch (default: HEAD).
force_branch: boolIf true, create a new branch even if one with the same name exists
(forces -B instead of -b). Default: false.
detach: boolIf true, detach HEAD in the new worktree instead of creating a branch.
Default: false.
Implementations§
Source§impl WorktreeCreateOpts
impl WorktreeCreateOpts
Sourcepub fn feature_branch(branch: &str, repo_root: &Path) -> Self
pub fn feature_branch(branch: &str, repo_root: &Path) -> Self
Build options for a simple feature-branch worktree.
The path is derived by appending the branch name (with / → -) as a
sibling directory next to the repo root.
Trait Implementations§
Source§impl Clone for WorktreeCreateOpts
impl Clone for WorktreeCreateOpts
Source§fn clone(&self) -> WorktreeCreateOpts
fn clone(&self) -> WorktreeCreateOpts
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorktreeCreateOpts
impl Debug for WorktreeCreateOpts
Source§impl<'de> Deserialize<'de> for WorktreeCreateOpts
impl<'de> Deserialize<'de> for WorktreeCreateOpts
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WorktreeCreateOpts
impl RefUnwindSafe for WorktreeCreateOpts
impl Send for WorktreeCreateOpts
impl Sync for WorktreeCreateOpts
impl Unpin for WorktreeCreateOpts
impl UnsafeUnpin for WorktreeCreateOpts
impl UnwindSafe for WorktreeCreateOpts
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more