pub enum Category<'a> {
Tag,
LocalBranch,
RemoteBranch,
Note,
PseudoRef,
MainPseudoRef,
MainRef,
LinkedPseudoRef {
name: &'a BStr,
},
LinkedRef {
name: &'a BStr,
},
Bisect,
Rewritten,
WorktreePrivate,
}
Expand description
The various known categories of references.
This translates into a prefix containing all references of a given category.
Variants§
Tag
A tag in refs/tags
LocalBranch
A branch in refs/heads
RemoteBranch
A branch in refs/remotes
Note
A tag in refs/notes
PseudoRef
Something outside of ref/
in the current worktree, typically HEAD
.
MainPseudoRef
A PseudoRef
, but referenced so that it will always refer to the main worktree by
prefixing it with main-worktree/
.
MainRef
Any reference that is prefixed with main-worktree/refs/
LinkedPseudoRef
Fields
name: &'a BStr
The name of the worktree.
A PseudoRef
in another linked worktree, never in the main one, like worktrees/<id>/HEAD
.
LinkedRef
Fields
name: &'a BStr
The name of the worktree.
Any reference that is prefixed with worktrees/<id>/refs/
.
Bisect
A ref that is private to each worktree (linked or main), with refs/bisect/
prefix
Rewritten
A ref that is private to each worktree (linked or main), with refs/rewritten/
prefix
WorktreePrivate
A ref that is private to each worktree (linked or main), with refs/worktree/
prefix
Implementations§
source§impl<'a> Category<'a>
impl<'a> Category<'a>
sourcepub fn prefix(&self) -> &BStr
pub fn prefix(&self) -> &BStr
Return the prefix that would contain all references of our kind, or an empty string if the reference would
be directly inside of the git_dir()
.
sourcepub fn is_worktree_private(&self) -> bool
pub fn is_worktree_private(&self) -> bool
Returns true if the category is private to their worktrees, and never shared with other worktrees.
Trait Implementations§
source§impl<'a> Ord for Category<'a>
impl<'a> Ord for Category<'a>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl<'a> PartialEq for Category<'a>
impl<'a> PartialEq for Category<'a>
source§impl<'a> PartialOrd for Category<'a>
impl<'a> PartialOrd for Category<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more