pub struct Commit<'a> { /* private fields */ }Expand description
Builder for git commit command.
See git commit --help for full documentation.
Implementations§
Source§impl<'a> Commit<'a>
impl<'a> Commit<'a>
Sourcepub fn porcelain(self) -> Self
pub fn porcelain(self) -> Self
Give output in machine-parseable format.
Corresponds to --porcelain.
Sourcepub fn porcelain_if(self, value: bool) -> Self
pub fn porcelain_if(self, value: bool) -> Self
Conditionally enable porcelain output.
Source§impl<'a> Commit<'a>
impl<'a> Commit<'a>
Sourcepub fn message(self, message: &'a str) -> Self
pub fn message(self, message: &'a str) -> Self
Set the commit message.
Corresponds to --message or -m.
Set the commit author.
Corresponds to --author. Format: Name <email>.
Sourcepub fn allow_empty(self) -> Self
pub fn allow_empty(self) -> Self
Allow creating a commit with no changes.
Corresponds to --allow-empty.
Sourcepub fn allow_empty_if(self, value: bool) -> Self
pub fn allow_empty_if(self, value: bool) -> Self
Conditionally allow creating a commit with no changes.
Sourcepub fn allow_empty_message(self) -> Self
pub fn allow_empty_message(self) -> Self
Allow creating a commit with an empty message.
Corresponds to --allow-empty-message.
Sourcepub fn allow_empty_message_if(self, value: bool) -> Self
pub fn allow_empty_message_if(self, value: bool) -> Self
Conditionally allow creating a commit with an empty message.
Sourcepub fn env(self, key: EnvVariableName<'a>, value: &'a OsStr) -> Self
pub fn env(self, key: EnvVariableName<'a>, value: &'a OsStr) -> Self
Set an environment variable for the command.
Sourcepub async fn status(self) -> Result<(), CommandError>
pub async fn status(self) -> Result<(), CommandError>
Execute the command and return the exit status.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Commit<'a>
impl<'a> RefUnwindSafe for Commit<'a>
impl<'a> Send for Commit<'a>
impl<'a> Sync for Commit<'a>
impl<'a> Unpin for Commit<'a>
impl<'a> UnwindSafe for Commit<'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