Skip to main content

Reset

Struct Reset 

Source
pub struct Reset<'a, S> { /* private fields */ }
Expand description

Builder for git reset command.

See git reset --help for full documentation.

Implementations§

Source§

impl<'a, S> Reset<'a, S>

Source

pub fn repo_path(self, path: &'a Path) -> Self

Set the repository path (-C <path>).

Source

pub fn hard(self) -> Self

Reset the index and working tree.

Corresponds to --hard.

Source

pub fn hard_if(self, value: bool) -> Self

Conditionally reset the index and working tree.

Source§

impl<'a> Reset<'a, NoTarget>

Source

pub fn commit_ish( self, commit_ish: impl Into<CommitIsh<'a>>, ) -> Reset<'a, WithTarget<'a>>

Select the commit-ish to reset to.

Calling this once locks the target in — selecting a second is a compile error.

Source§

impl<'a, S> Reset<'a, S>
where Self: Build,

Source

pub async fn status(self) -> Result<(), CommandError>

Execute the command and return the exit status.

Trait Implementations§

Source§

impl Build for Reset<'_, NoTarget>

Source§

fn build(self) -> Command

Build the command without executing it.
Source§

impl<'a> Build for Reset<'a, WithTarget<'a>>

Source§

fn build(self) -> Command

Build the command without executing it.
Source§

impl<'a, S: Debug> Debug for Reset<'a, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, S> RepoPath<'a> for Reset<'a, S>

Source§

fn repo_path(self, path: &'a Path) -> Self

Set the repository path (-C <path>).

Auto Trait Implementations§

§

impl<'a, S> Freeze for Reset<'a, S>
where S: Freeze,

§

impl<'a, S> RefUnwindSafe for Reset<'a, S>
where S: RefUnwindSafe,

§

impl<'a, S> Send for Reset<'a, S>
where S: Send,

§

impl<'a, S> Sync for Reset<'a, S>
where S: Sync,

§

impl<'a, S> Unpin for Reset<'a, S>
where S: Unpin,

§

impl<'a, S> UnsafeUnpin for Reset<'a, S>
where S: UnsafeUnpin,

§

impl<'a, S> UnwindSafe for Reset<'a, S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.