pub struct GitButlerWorkspace {
pub commit: ObjectId,
pub heads: Vec<WorkspaceHead>,
}Expand description
A checked-out GitButler workspace: HEAD is on WORKSPACE_BRANCH and its tip is the
workspace commit (WORKSPACE_COMMIT_MARKER in its message).
Fields§
§commit: ObjectIdThe workspace commit at the tip of WORKSPACE_BRANCH.
heads: Vec<WorkspaceHead>The heads merged into the workspace commit, in its parent order.
Implementations§
Source§impl GitButlerWorkspace
impl GitButlerWorkspace
Sourcepub fn detect(repo: &Repository) -> Result<Option<Self>>
pub fn detect(repo: &Repository) -> Result<Option<Self>>
The workspace repo has checked out, or None when HEAD is not on one.
HEAD must be on WORKSPACE_BRANCH and that branch’s tip must be a commit whose
message contains WORKSPACE_COMMIT_MARKER; a gitbutler/workspace branch with any
other tip is treated as an ordinary branch.
§Errors
Returns ref store and object database errors from reading HEAD, the tip commit or the
local branches.
Sourcepub fn head_commits(&self) -> Vec<ObjectId>
pub fn head_commits(&self) -> Vec<ObjectId>
The merged heads’ commits, in parent order: where history of the applied work starts.
Sourcepub fn standing(
&self,
repo: &Repository,
target: &TrackedComparison,
) -> Result<WorkspaceStanding>
pub fn standing( &self, repo: &Repository, target: &TrackedComparison, ) -> Result<WorkspaceStanding>
How the applied work stands against target, with the workspace commit left out.
target is the comparison of HEAD (the workspace commit) with the target branch, as
BranchStanding::compute returns it. The workspace commit is bookkeeping, so it is dropped from the ahead count
and the newest ahead commits, and each head is compared with the target on its own.
When target was computed without counts, no head is compared either.
§Parameters
repo: the repository the workspace was detected in.target:HEAD’s comparison with the target branch.
§Errors
Propagates object read and parse errors from comparing a head with the target.
Trait Implementations§
Source§impl Clone for GitButlerWorkspace
impl Clone for GitButlerWorkspace
Source§impl Debug for GitButlerWorkspace
impl Debug for GitButlerWorkspace
impl Eq for GitButlerWorkspace
Source§impl PartialEq for GitButlerWorkspace
impl PartialEq for GitButlerWorkspace
impl StructuralPartialEq for GitButlerWorkspace
Auto Trait Implementations§
impl Forget for GitButlerWorkspace
impl Freeze for GitButlerWorkspace
impl RefUnwindSafe for GitButlerWorkspace
impl Send for GitButlerWorkspace
impl Sync for GitButlerWorkspace
impl Unpin for GitButlerWorkspace
impl UnsafeUnpin for GitButlerWorkspace
impl UnwindSafe for GitButlerWorkspace
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.