pub struct CommitOptions { /* private fields */ }
Expand description
git commit
command.
use mhgit::{CommandOptions, Repository};
use mhgit::commands::CommitOptions;
let repo = Repository::new();
CommitOptions::new()
.amend(true)
.file("foo.txt")
.message("Initial commit")
.run(&repo)?;
Implementations§
Source§impl CommitOptions
impl CommitOptions
Sourcepub fn new() -> CommitOptions
pub fn new() -> CommitOptions
Create a new set of git commit
options.
Sourcepub fn all(&mut self, val: bool) -> &mut CommitOptions
pub fn all(&mut self, val: bool) -> &mut CommitOptions
Add –all options.
Sourcepub fn allow_empty(&mut self, val: bool) -> &mut CommitOptions
pub fn allow_empty(&mut self, val: bool) -> &mut CommitOptions
Add –allow-empty option.
Sourcepub fn amend(&mut self, val: bool) -> &mut CommitOptions
pub fn amend(&mut self, val: bool) -> &mut CommitOptions
Add –amend option.
Sourcepub fn file(&mut self, file: impl ToString) -> &mut CommitOptions
pub fn file(&mut self, file: impl ToString) -> &mut CommitOptions
Add file to commit command.
Sourcepub fn files<I, S>(&mut self, files: I) -> &mut CommitOptionswhere
I: IntoIterator<Item = S>,
S: ToString,
pub fn files<I, S>(&mut self, files: I) -> &mut CommitOptionswhere
I: IntoIterator<Item = S>,
S: ToString,
Add multiple files to commit command.
Sourcepub fn message(&mut self, msg: &str) -> &mut CommitOptions
pub fn message(&mut self, msg: &str) -> &mut CommitOptions
Set commit message.
Trait Implementations§
Source§impl CommandOptions for CommitOptions
impl CommandOptions for CommitOptions
Source§impl Debug for CommitOptions
impl Debug for CommitOptions
Source§impl Default for CommitOptions
impl Default for CommitOptions
Source§fn default() -> CommitOptions
fn default() -> CommitOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CommitOptions
impl RefUnwindSafe for CommitOptions
impl Send for CommitOptions
impl Sync for CommitOptions
impl Unpin for CommitOptions
impl UnwindSafe for CommitOptions
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> 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