pub struct RevParseCommand {
pub executor: CommandExecutor,
pub rev_args: Vec<String>,
pub verify: bool,
pub abbrev_ref: bool,
pub short: Option<Option<u32>>,
pub show_toplevel: bool,
pub git_dir: bool,
pub is_inside_work_tree: bool,
pub is_bare_repository: bool,
pub absolute_git_dir: bool,
}Expand description
Builder for git rev-parse.
Fields§
§executor: CommandExecutorShared executor.
rev_args: Vec<String>Arguments / refs / flags to pass to rev-parse.
verify: bool--verify.
abbrev_ref: bool--abbrev-ref.
short: Option<Option<u32>>--short[=N].
show_toplevel: bool--show-toplevel.
git_dir: bool--git-dir.
is_inside_work_tree: bool--is-inside-work-tree.
is_bare_repository: bool--is-bare-repository.
absolute_git_dir: bool--absolute-git-dir.
Implementations§
Source§impl RevParseCommand
impl RevParseCommand
Sourcepub fn arg_str(&mut self, s: impl Into<String>) -> &mut Self
pub fn arg_str(&mut self, s: impl Into<String>) -> &mut Self
Add a ref/rev string (e.g. "HEAD", "main", "HEAD~3").
Sourcepub fn abbrev_ref(&mut self) -> &mut Self
pub fn abbrev_ref(&mut self) -> &mut Self
--abbrev-ref: print the short ref name.
Sourcepub fn show_toplevel(&mut self) -> &mut Self
pub fn show_toplevel(&mut self) -> &mut Self
--show-toplevel.
Sourcepub fn absolute_git_dir(&mut self) -> &mut Self
pub fn absolute_git_dir(&mut self) -> &mut Self
--absolute-git-dir.
Sourcepub fn is_inside_work_tree(&mut self) -> &mut Self
pub fn is_inside_work_tree(&mut self) -> &mut Self
--is-inside-work-tree.
Sourcepub fn is_bare_repository(&mut self) -> &mut Self
pub fn is_bare_repository(&mut self) -> &mut Self
--is-bare-repository.
Trait Implementations§
Source§impl Clone for RevParseCommand
impl Clone for RevParseCommand
Source§fn clone(&self) -> RevParseCommand
fn clone(&self) -> RevParseCommand
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 RevParseCommand
impl Debug for RevParseCommand
Source§impl Default for RevParseCommand
impl Default for RevParseCommand
Source§fn default() -> RevParseCommand
fn default() -> RevParseCommand
Returns the “default value” for a type. Read more
Source§impl GitCommand for RevParseCommand
impl GitCommand for RevParseCommand
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<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + 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 RevParseCommand
impl RefUnwindSafe for RevParseCommand
impl Send for RevParseCommand
impl Sync for RevParseCommand
impl Unpin for RevParseCommand
impl UnsafeUnpin for RevParseCommand
impl UnwindSafe for RevParseCommand
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