pub struct RepoInfo {
pub branch: Option<String>,
pub upstream: Option<String>,
pub default_branch: Option<String>,
pub dirty: bool,
pub ahead: u32,
pub behind: u32,
}Available on crate feature
workflow only.Expand description
Snapshot of a repository’s state.
Fields are populated independently — a missing upstream leaves upstream,
ahead, and behind at their defaults (None, 0, 0); a missing remote
leaves default_branch at None.
Fields§
§branch: Option<String>Current branch, or None when HEAD is detached.
upstream: Option<String>Configured upstream in remote/branch form (e.g. "origin/main").
default_branch: Option<String>Default branch as advertised by refs/remotes/origin/HEAD
(short form, e.g. "main"). None when no origin remote is
configured or the symbolic ref is missing.
dirty: booltrue when the working tree or index has any pending changes
(modified, staged, untracked, etc.).
ahead: u32Commits the current branch is ahead of its upstream.
behind: u32Commits the current branch is behind its upstream.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RepoInfo
impl<'de> Deserialize<'de> for RepoInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RepoInfo
impl StructuralPartialEq for RepoInfo
Auto Trait Implementations§
impl Freeze for RepoInfo
impl RefUnwindSafe for RepoInfo
impl Send for RepoInfo
impl Sync for RepoInfo
impl Unpin for RepoInfo
impl UnsafeUnpin for RepoInfo
impl UnwindSafe for RepoInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more