pub struct GitCli { /* private fields */ }
Expand description
Support for source control operations through running Git commands.
This assumes that the underlying Git repository doesn’t change in the middle of an operation, and caches data as a result. If mutation operations are added, the caches would need to be invalidated.
Implementations§
source§impl GitCli
impl GitCli
sourcepub fn tracked_files(&self) -> Result<&Utf8Paths0>
pub fn tracked_files(&self) -> Result<&Utf8Paths0>
Returns the files tracked by Git in this working copy.
The return value can be iterated on to get a list of paths.
sourcepub fn merge_base(&self, commit_ref: &str) -> Result<GitHash>
pub fn merge_base(&self, commit_ref: &str) -> Result<GitHash>
Returns the merge base of the current commit (HEAD
) with the specified commit.
sourcepub fn files_changed_between<'a>(
&self,
old: impl Into<Cow<'a, OsStr>>,
new: impl Into<Option<Cow<'a, OsStr>>>,
diff_filter: Option<&str>
) -> Result<Utf8Paths0>
pub fn files_changed_between<'a>( &self, old: impl Into<Cow<'a, OsStr>>, new: impl Into<Option<Cow<'a, OsStr>>>, diff_filter: Option<&str> ) -> Result<Utf8Paths0>
Returns the files changed between the given commits, or the current directory if the new commit isn’t specified.
For more about the diff filter, see man git-diff
’s help for --diff-filter
.
sourcepub fn package_graph_at(&self, commit_ref: &GitHash) -> Result<PackageGraph>
pub fn package_graph_at(&self, commit_ref: &GitHash) -> Result<PackageGraph>
Returns a package graph for the given commit, using a scratch repo if necessary.
pub fn is_git_repo(&self, dir: &Utf8Path) -> Result<bool>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for GitCli
impl Send for GitCli
impl Sync for GitCli
impl Unpin for GitCli
impl UnwindSafe for GitCli
Blanket Implementations§
§impl<'a, T> DefaultFeatures<'a> for Twhere
T: 'a + Send + Sync + Clone,
impl<'a, T> DefaultFeatures<'a> for Twhere T: 'a + Send + Sync + Clone,
§fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
Clone this value, and then immediately put it into a
Box
behind a trait object of this trait.§fn self_address_mut(&mut self) -> *mut ()
fn self_address_mut(&mut self) -> *mut ()
Returns the address of
self
. Read more§impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
impl<'a, T> NonSyncFeatures<'a> for Twhere T: 'a + Clone,
§fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
Clone this value, and then immediately put it into a
Box
behind a trait object of this trait.§fn self_address_mut(&mut self) -> *mut ()
fn self_address_mut(&mut self) -> *mut ()
Returns the address of
self
. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
impl<T> SafeBorrow<T> for Twhere T: ?Sized,
§fn borrow_replacement(ptr: &T) -> &T
fn borrow_replacement(ptr: &T) -> &T
Given
ptr
, which was obtained from a prior call to Self::borrow()
,
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self
. Read more