[][src]Struct git_workarea::GitWorkArea

pub struct GitWorkArea { /* fields omitted */ }

A representation of an empty workarea where actions which require a work tree and an index may be preformed.

Methods

impl GitWorkArea[src]

pub fn new(context: GitContext, rev: &CommitId) -> Result<Self, WorkAreaError>[src]

Create an area for performing actions which require a work tree.

pub fn git(&self) -> Command[src]

Run a git command in the workarea.

pub fn checkout<I, P>(&mut self, paths: I) -> Result<(), GitError> where
    I: IntoIterator<Item = P>,
    P: AsRef<OsStr>, 
[src]

Checkout paths from the index to the filesystem.

Normally, files are not placed into the worktree, so checks which use other tools to inspect file contents do not work. This method checks out files to the working directory and fixes up Git's knowledge that they are there.

All paths supported by Git's globbing and searching mechanisms are supported.

pub fn setup_merge<'a>(
    &'a self,
    bases: &[CommitId],
    base: &CommitId,
    topic: &CommitId
) -> Result<MergeResult<'a>, GitError>
[src]

Prepare a command to create a merge commit.

The merge is performed, but only as a tree object. In order to create the actual commit object, a successful merge returns a command which should be executed to create the commit object. That commit object should then be stored in a reference using git update-ref.

pub fn setup_update_merge<'a>(
    &'a self,
    base: &CommitId,
    topic: &CommitId
) -> Result<MergeResult<'a>, GitError>
[src]

Prepare a command to create a merge commit.

The merge is performed, but only as a tree object. In order to create the actual commit object, a successful merge returns a command which should be executed to create the commit object. That commit object should then be stored in a reference using git update-ref.

pub fn cd_to_work_tree<'a>(&self, cmd: &'a mut Command) -> &'a mut Command[src]

Run a command from the work tree root.

pub fn gitdir(&self) -> &Path[src]

The path to the git repository.

pub fn submodule_config(&self) -> &SubmoduleConfig[src]

The submodule configuration for the repository.

This is read from the .gitmodules file in the commit (if it exists).

Trait Implementations

impl Debug for GitWorkArea[src]

Auto Trait Implementations

Blanket Implementations

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

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

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]