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 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
A PseudoRef
in another linked worktree, never in the main one, like worktrees/<id>/HEAD
.
LinkedRef
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 Category<'_>
Conversion
impl Category<'_>
Conversion
Sourcepub fn to_full_name<'a>(
&self,
short_name: impl Into<&'a BStr>,
) -> Result<FullName, Error>
pub fn to_full_name<'a>( &self, short_name: impl Into<&'a BStr>, ) -> Result<FullName, Error>
As the inverse of FullNameRef::category_and_short_name()
, use the prefix of this category alongside
the short_name
to create a valid fully qualified reference name.
Source§impl Category<'_>
impl Category<'_>
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.