pub enum InFlightOp {
Merge,
Rebase,
CherryPick,
Revert,
ApplyPatch,
}Expand description
A multi-commit operation stopped mid-flight.
Ordered by specificity in InFlightOp::detect: git am and
rebase share the rebase-apply directory, so the more specific
marker is tested first.
Variants§
Merge
A merge stopped with conflicts — MERGE_HEAD.
Rebase
A rebase stopped at a conflict or an edit stop —
rebase-merge/ (the default backend) or rebase-apply/ (the
legacy --apply backend).
CherryPick
A cherry-pick sequence stopped — CHERRY_PICK_HEAD.
Revert
A revert sequence stopped — REVERT_HEAD.
ApplyPatch
git am stopped applying a patch — rebase-apply/applying.
Implementations§
Source§impl InFlightOp
impl InFlightOp
Sourcepub fn label(self) -> &'static str
pub fn label(self) -> &'static str
The headerline alert for this state, in the wording git itself uses when it tells the user what to do next.
Sourcepub fn ours_is_local(self) -> bool
pub fn ours_is_local(self) -> bool
Which side of a conflict “us” and “them” name during this operation — and they INVERT between the two families.
In a merge, “us” is the branch you are on and “them” is the
branch being merged in, which is what everyone expects. In a
rebase, cherry-pick, revert or am, git replays your work ONTO
the other side, so “us” is the upstream being replayed onto
and “them” is your own commit.
This is the single most confusing thing about resolving a conflict mid-rebase, and it is why the unmerged labels (“added by us”, “deleted by them”) are ambiguous without knowing which operation produced them.
Sourcepub fn detect(repo: &Repository) -> Option<Self>
pub fn detect(repo: &Repository) -> Option<Self>
Detect the operation in flight, or None when the repository
is idle.
At most one is reported. They are not strictly exclusive in
git’s data model — a rebase that hits a conflict while
cherry-picking a commit writes CHERRY_PICK_HEAD too — so the
order matters: the outer operation is the one the user has to
finish, and the one whose --continue they need.
Sourcepub fn detect_in(gitdir: &Path) -> Option<Self>
pub fn detect_in(gitdir: &Path) -> Option<Self>
Self::detect against a gitdir path directly, so it is
testable without a live repository.
Trait Implementations§
Source§impl Clone for InFlightOp
impl Clone for InFlightOp
Source§fn clone(&self) -> InFlightOp
fn clone(&self) -> InFlightOp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InFlightOp
Source§impl Debug for InFlightOp
impl Debug for InFlightOp
impl Eq for InFlightOp
Source§impl Hash for InFlightOp
impl Hash for InFlightOp
Source§impl PartialEq for InFlightOp
impl PartialEq for InFlightOp
impl StructuralPartialEq for InFlightOp
Auto Trait Implementations§
impl Freeze for InFlightOp
impl RefUnwindSafe for InFlightOp
impl Send for InFlightOp
impl Sync for InFlightOp
impl Unpin for InFlightOp
impl UnsafeUnpin for InFlightOp
impl UnwindSafe for InFlightOp
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.