Struct git_workarea::GitContext
[−]
[src]
pub struct GitContext { /* fields omitted */ }
A context for performing git commands.
Methods
impl GitContext
[src]
fn new<P>(gitdir: P) -> Self where P: AsRef<Path>
Create a new context for the given directory.
fn new_with_config<P, C>(gitdir: P, config: C) -> Self where P: AsRef<Path>, C: AsRef<Path>
Create a new context for the given directory with git configuration.
fn git(&self) -> Command
Run a git command in the context.
fn fetch<R, N>(&self, remote: R, refnames: &[N]) -> Result<()> where R: AsRef<str>, N: AsRef<str>
Fetch a commit from the given remote.
fn fetch_into<R, N, T>(&self, remote: R, refname: N, target: T) -> Result<()> where R: AsRef<str>, N: AsRef<str>, T: AsRef<str>
Fetch a commit from the given remote into a custom refname.
fn force_fetch_into<R, N, T>(&self,
remote: R,
refname: N,
target: T)
-> Result<()> where R: AsRef<str>, N: AsRef<str>, T: AsRef<str>
remote: R,
refname: N,
target: T)
-> Result<()> where R: AsRef<str>, N: AsRef<str>, T: AsRef<str>
Fetch a commit from the given remote into a custom refname, allowing rewinds.
fn prepare(&self, rev: &CommitId) -> Result<PreparedGitWorkArea>
Create a tree where further work on the given revision can occur.
fn reserve_ref<N>(&self, name: N, commit: &CommitId) -> Result<(String, usize)> where N: AsRef<str>
Reserve a refname for the given commit.
Returns the name of the reserved ref pointing to the given commit and its ID.
The refs are placed under the name
parameter's directory as the {name}/heads/{id}
name.
fn reserve_refs<N>(&self,
name: N,
commit: &CommitId)
-> Result<(String, String)> where N: AsRef<str>
name: N,
commit: &CommitId)
-> Result<(String, String)> where N: AsRef<str>
Reserve two refnames for the given commit.
Returns the names of the two reserved refs, the first pointing to the given commit and the second available for further work.
The refs are placed under the name
parameter's directory in the {name}/heads/{id}
and
{name}/bases/{id}
names. It is assumed that the bases
refs are left alone other than in
accordance with the workings of this routine.
fn mergeable(&self, base: &CommitId, topic: &CommitId) -> Result<MergeStatus>
Check if a topic commit is mergeable into a target branch.
fn gitdir(&self) -> &Path
The path to the git repository.
Trait Implementations
impl Debug for GitContext
[src]
impl Clone for GitContext
[src]
fn clone(&self) -> GitContext
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more