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
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<'_>
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.
Trait Implementations§
source§impl<'de: 'a, 'a> Deserialize<'de> for Category<'a>
impl<'de: 'a, 'a> Deserialize<'de> for Category<'a>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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> PartialOrd for Category<'a>
impl<'a> PartialOrd for Category<'a>
impl<'a> Copy for Category<'a>
impl<'a> Eq for Category<'a>
impl<'a> StructuralPartialEq for Category<'a>
Auto Trait Implementations§
impl<'a> Freeze for Category<'a>
impl<'a> RefUnwindSafe for Category<'a>
impl<'a> Send for Category<'a>
impl<'a> Sync for Category<'a>
impl<'a> Unpin for Category<'a>
impl<'a> UnwindSafe for Category<'a>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)