Skip to main content

parse_git_ref

Function parse_git_ref 

Source
pub fn parse_git_ref(ref_name: &str) -> Option<ParsedGitRef<'_>>
Expand description

Parse a fully-qualified Git ref name into its GitRefKind, short name, and owning remote. Returns None for refs outside the branch/remote-branch/tag namespaces (e.g. refs/notes/*, HEAD).

Ported from jj’s parse_git_ref (lib/src/git.rs); like jj, the symbolic HEAD and refs/remotes/<remote>/HEAD entries are not treated as refs.