[−][src]Struct git_workarea::GitWorkArea
A representation of an empty workarea where actions which require a work tree and an index may be preformed.
Implementations
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]
I: IntoIterator<Item = P>,
P: AsRef<OsStr>,
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]
&'a self,
bases: &[CommitId],
base: &CommitId,
topic: &CommitId
) -> Result<MergeResult<'a>, GitError>
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]
&'a self,
base: &CommitId,
topic: &CommitId
) -> Result<MergeResult<'a>, GitError>
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
Auto Trait Implementations
impl RefUnwindSafe for GitWorkArea
impl Send for GitWorkArea
impl Sync for GitWorkArea
impl Unpin for GitWorkArea
impl UnwindSafe for GitWorkArea
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,