Struct GitDetails

Source
pub struct GitDetails {
Show 25 fields pub abspath: String, pub head_commit_hash: String, pub local_branch: String, pub upstream_branch: String, pub remote_name: String, pub remote_url: String, pub repository_state: String, pub num_files_in_index: u32, pub num_staged_changes: u32, pub num_unstaged_changes: u32, pub num_conflicted_changes: u32, pub num_untrached_files: u32, pub commits_ahead: u32, pub commits_behind: u32, pub num_stashes: u32, pub last_tag: String, pub num_unstaged_deleted: u32, pub num_staged_new: u32, pub num_staged_deleted: u32, pub push_remote_name: String, pub push_remote_url: String, pub commits_ahead_push_remote: u32, pub commits_behind_push_remote: u32, pub num_index_skip_worktree: u32, pub num_index_assume_unchanged: u32,
}
Expand description

Details about git state.

Note: Renamed files are reported as deleted plus new.

Fields§

§abspath: String

Absolute path to the git repository workdir.

§head_commit_hash: String

Commit hash that HEAD is pointing to. 40 hex digits.

§local_branch: String

Local branch name or empty if not on a branch.

§upstream_branch: String

Upstream branch name. Can be empty.

§remote_name: String

The remote name, e.g. “upstream” or “origin”.

§remote_url: String

Remote URL. Can be empty.

§repository_state: String

Repository state, A.K.A. action. Can be empty.

§num_files_in_index: u32

The number of files in the index.

§num_staged_changes: u32

The number of staged changes.

§num_unstaged_changes: u32

The number of unstaged changes.

§num_conflicted_changes: u32

The number of conflicted changes.

§num_untrached_files: u32

The number of untracked files.

§commits_ahead: u32

Number of commits the current branch is ahead of upstream.

§commits_behind: u32

Number of commits the current branch is behind upstream.

§num_stashes: u32

The number of stashes.

§last_tag: String

The last tag (in lexicographical order) that points to the same commit as HEAD.

§num_unstaged_deleted: u32

The number of unstaged deleted files.

§num_staged_new: u32

The number of staged new files.

§num_staged_deleted: u32

The number of staged deleted files.

§push_remote_name: String

The push remote name, e.g. “upstream” or “origin”.

§push_remote_url: String

Push remote URL. Can be empty.

§commits_ahead_push_remote: u32

Number of commits the current branch is ahead of push remote.

§commits_behind_push_remote: u32

Number of commits the current branch is behind push remote.

§num_index_skip_worktree: u32

Number of files in the index with skip-worktree bit set.

§num_index_assume_unchanged: u32

Number of files in the index with assume-unchanged bit set.

Trait Implementations§

Source§

impl Debug for GitDetails

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for GitDetails

Source§

fn eq(&self, other: &GitDetails) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for GitDetails

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.