pub struct CommitCommand {Show 15 fields
pub executor: CommandExecutor,
pub message: Option<String>,
pub message_file: Option<PathBuf>,
pub all: bool,
pub amend: bool,
pub no_edit: bool,
pub allow_empty: bool,
pub allow_empty_message: bool,
pub signoff: bool,
pub no_verify: bool,
pub author: Option<String>,
pub date: Option<String>,
pub only_paths: Vec<String>,
pub quiet: bool,
pub verbose: bool,
}Expand description
Builder for git commit.
Fields§
§executor: CommandExecutorShared executor.
message: Option<String>-m.
message_file: Option<PathBuf>-F file.
all: bool--all / -a.
amend: bool--amend.
no_edit: bool--no-edit.
allow_empty: bool--allow-empty.
allow_empty_message: bool--allow-empty-message.
signoff: bool--signoff / -s.
no_verify: bool--no-verify.
--author.
date: Option<String>--date.
only_paths: Vec<String>--only specific paths.
quiet: bool--quiet.
verbose: bool--verbose.
Implementations§
Source§impl CommitCommand
impl CommitCommand
Sourcepub fn with_message(msg: impl Into<String>) -> Self
pub fn with_message(msg: impl Into<String>) -> Self
Convenience: commit with a message.
Sourcepub fn message_file(&mut self, path: impl Into<PathBuf>) -> &mut Self
pub fn message_file(&mut self, path: impl Into<PathBuf>) -> &mut Self
Read the commit message from a file (-F).
Sourcepub fn no_edit(&mut self) -> &mut Self
pub fn no_edit(&mut self) -> &mut Self
Reuse the last commit message without opening the editor.
Sourcepub fn allow_empty(&mut self) -> &mut Self
pub fn allow_empty(&mut self) -> &mut Self
Allow an empty commit.
Sourcepub fn allow_empty_message(&mut self) -> &mut Self
pub fn allow_empty_message(&mut self) -> &mut Self
Allow an empty commit message.
Override the author (--author="Name <email>").
Trait Implementations§
Source§impl Clone for CommitCommand
impl Clone for CommitCommand
Source§fn clone(&self) -> CommitCommand
fn clone(&self) -> CommitCommand
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 CommitCommand
impl Debug for CommitCommand
Source§impl Default for CommitCommand
impl Default for CommitCommand
Source§fn default() -> CommitCommand
fn default() -> CommitCommand
Returns the “default value” for a type. Read more
Source§impl GitCommand for CommitCommand
impl GitCommand for CommitCommand
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 CommitCommand
impl RefUnwindSafe for CommitCommand
impl Send for CommitCommand
impl Sync for CommitCommand
impl Unpin for CommitCommand
impl UnsafeUnpin for CommitCommand
impl UnwindSafe for CommitCommand
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