pub struct BranchCommand {Show 18 fields
pub executor: CommandExecutor,
pub list: bool,
pub all: bool,
pub remotes: bool,
pub verbose: bool,
pub name: Option<String>,
pub start_point: Option<String>,
pub delete: Option<String>,
pub force_delete: bool,
pub rename_from: Option<String>,
pub rename_to: Option<String>,
pub track: bool,
pub no_track: bool,
pub set_upstream_to: Option<String>,
pub unset_upstream: bool,
pub show_current: bool,
pub contains: Option<String>,
pub merged: Option<String>,
}Expand description
Builder for git branch.
Fields§
§executor: CommandExecutorShared executor.
list: bool-l list.
all: bool-a include remotes.
remotes: bool-r remotes only.
verbose: bool-v verbose.
name: Option<String>Branch to create or operate on.
start_point: Option<String>Start-point for creation.
delete: Option<String>-d.
force_delete: bool-D force delete.
rename_from: Option<String>-m.
rename_to: Option<String>-m target.
track: bool--track.
no_track: bool--no-track.
set_upstream_to: Option<String>--set-upstream-to.
unset_upstream: bool--unset-upstream.
show_current: bool--show-current.
contains: Option<String>--contains filter.
merged: Option<String>--merged filter.
Implementations§
Source§impl BranchCommand
impl BranchCommand
Sourcepub fn start_point(&mut self, sp: impl Into<String>) -> &mut Self
pub fn start_point(&mut self, sp: impl Into<String>) -> &mut Self
Start-point for create.
Sourcepub fn force_delete(&mut self) -> &mut Self
pub fn force_delete(&mut self) -> &mut Self
Force delete.
Sourcepub fn rename(
&mut self,
from: impl Into<String>,
to: impl Into<String>,
) -> &mut Self
pub fn rename( &mut self, from: impl Into<String>, to: impl Into<String>, ) -> &mut Self
Rename branch (-m <old> <new>).
Sourcepub fn set_upstream_to(&mut self, s: impl Into<String>) -> &mut Self
pub fn set_upstream_to(&mut self, s: impl Into<String>) -> &mut Self
Set upstream.
Sourcepub fn unset_upstream(&mut self) -> &mut Self
pub fn unset_upstream(&mut self) -> &mut Self
Unset upstream.
Sourcepub fn show_current(&mut self) -> &mut Self
pub fn show_current(&mut self) -> &mut Self
--show-current.
Trait Implementations§
Source§impl Clone for BranchCommand
impl Clone for BranchCommand
Source§fn clone(&self) -> BranchCommand
fn clone(&self) -> BranchCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BranchCommand
impl Debug for BranchCommand
Source§impl Default for BranchCommand
impl Default for BranchCommand
Source§fn default() -> BranchCommand
fn default() -> BranchCommand
Returns the “default value” for a type. Read more
Source§impl GitCommand for BranchCommand
impl GitCommand for BranchCommand
Source§type Output = CommandOutput
type Output = CommandOutput
The typed output produced by this command.
Source§fn get_executor(&self) -> &CommandExecutor
fn get_executor(&self) -> &CommandExecutor
Borrow the shared executor.
Source§fn get_executor_mut(&mut self) -> &mut CommandExecutor
fn get_executor_mut(&mut self) -> &mut CommandExecutor
Mutably borrow the shared executor.
Source§fn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build the full argument vector (subcommand + flags + positionals)
excluding the leading
git program.Source§fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run the command and decode its output into
Self::Output.Source§fn execute_raw<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn execute_raw<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Spawn
git with the given arguments and return the raw output. Read moreSource§fn current_dir<P: Into<PathBuf>>(&mut self, dir: P) -> &mut Self
fn current_dir<P: Into<PathBuf>>(&mut self, dir: P) -> &mut Self
Run
git in the given working directory.Source§fn env<K: Into<OsString>, V: Into<OsString>>(
&mut self,
key: K,
value: V,
) -> &mut Self
fn env<K: Into<OsString>, V: Into<OsString>>( &mut self, key: K, value: V, ) -> &mut Self
Set an environment variable for this invocation.
Source§fn with_timeout(&mut self, timeout: Duration) -> &mut Self
fn with_timeout(&mut self, timeout: Duration) -> &mut Self
Cap execution time. On expiry the process is killed and
Error::Timeout is returned.Source§fn with_timeout_secs(&mut self, seconds: u64) -> &mut Self
fn with_timeout_secs(&mut self, seconds: u64) -> &mut Self
Convenience: set timeout in whole seconds.
Auto Trait Implementations§
impl Freeze for BranchCommand
impl RefUnwindSafe for BranchCommand
impl Send for BranchCommand
impl Sync for BranchCommand
impl Unpin for BranchCommand
impl UnsafeUnpin for BranchCommand
impl UnwindSafe for BranchCommand
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