pub struct Status {
pub state: State,
pub index_id: Option<ObjectId>,
pub checked_out_head_id: Option<ObjectId>,
pub changes: Option<Vec<Item>>,
}status and attributes only.Expand description
A simplified status of the Submodule.
As opposed to the similar-sounding State, it is more exhaustive and potentially expensive to compute,
particularly for submodules without changes.
It’s produced by Submodule::status().
Fields§
§state: StateThe cheapest part of the status that is always performed, to learn if the repository is cloned and if there is a worktree checkout.
index_id: Option<ObjectId>The commit at which the submodule is supposed to be according to the super-project’s index.
None means the computation wasn’t performed, or the submodule didn’t exist in the super-project’s index anymore.
checked_out_head_id: Option<ObjectId>The commit-id of the HEAD at which the submodule is currently checked out.
None if the computation wasn’t performed as it was skipped early, or if no repository was available or
if the HEAD could not be obtained or wasn’t born.
changes: Option<Vec<Item>>The set of changes obtained from running something akin to git status in the submodule working tree.
None if the computation wasn’t performed as the computation was skipped early, or if no working tree was
available or repository was available.
Implementations§
Source§impl Status
impl Status
Sourcepub fn is_dirty(&self) -> Option<bool>
pub fn is_dirty(&self) -> Option<bool>
Return Some(true) if the submodule status could be determined sufficiently and
if there are changes that would render this submodule dirty.
Return Some(false) if the submodule status could be determined and it has no changes
at all.
Return None if the repository clone or the worktree are missing entirely, which would leave
it to the caller to determine if that’s considered dirty or not.