[][src]Struct git2::Rebase

pub struct Rebase<'repo> { /* fields omitted */ }

Representation of a rebase

Methods

impl<'repo> Rebase<'repo>[src]

pub fn len(&self) -> usize[src]

Gets the count of rebase operations that are to be applied.

pub fn nth(&mut self, n: usize) -> Option<RebaseOperation>[src]

Gets the rebase operation specified by the given index.

pub fn operation_current(&mut self) -> Option<usize>[src]

Gets the index of the rebase operation that is currently being applied. If the first operation has not yet been applied (because you have called init but not yet next) then this returns None.

pub fn inmemory_index(&mut self) -> Result<Index, Error>[src]

Gets the index produced by the last operation, which is the result of next() and which will be committed by the next invocation of commit(). This is useful for resolving conflicts in an in-memory rebase before committing them.

This is only applicable for in-memory rebases; for rebases within a working directory, the changes were applied to the repository's index.

pub fn commit(
    &mut self,
    author: Option<&Signature>,
    committer: &Signature,
    message: Option<&str>
) -> Result<Oid, Error>
[src]

Commits the current patch. You must have resolved any conflicts that were introduced during the patch application from the git_rebase_next invocation. To keep the author and message from the original commit leave them as None

pub fn abort(&mut self) -> Result<(), Error>[src]

Aborts a rebase that is currently in progress, resetting the repository and working directory to their state before rebase began.

pub fn finish(&mut self, signature: Option<&Signature>) -> Result<(), Error>[src]

Finishes a rebase that is currently in progress once all patches have been applied.

Trait Implementations

impl<'repo> Drop for Rebase<'repo>[src]

impl<'rebase> Iterator for Rebase<'rebase>[src]

type Item = Result<RebaseOperation<'rebase>, Error>

The type of the elements being iterated over.

fn next(&mut self) -> Option<Result<RebaseOperation<'rebase>, Error>>[src]

Performs the next rebase operation and returns the information about it. If the operation is one that applies a patch (which is any operation except GitRebaseOperation::Exec) then the patch will be applied and the index and working directory will be updated with the changes. If there are conflicts, you will need to address those before committing the changes.

Auto Trait Implementations

impl<'repo> !Send for Rebase<'repo>

impl<'repo> !Sync for Rebase<'repo>

impl<'repo> Unpin for Rebase<'repo>

impl<'repo> UnwindSafe for Rebase<'repo>

impl<'repo> RefUnwindSafe for Rebase<'repo>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]