mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-03 21:59:49 +00:00
Merge pull request #4124 from pks-t/pks/worktree-refs
refdb: catch additional per-worktree refs
This commit is contained in:
commit
021f4943a9
@ -365,12 +365,17 @@ static const char *loose_parse_symbolic(git_buf *file_content)
|
|||||||
return refname_start;
|
return refname_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns whether a reference is stored per worktree or not.
|
||||||
|
* Per-worktree references are:
|
||||||
|
*
|
||||||
|
* - all pseudorefs, e.g. HEAD and MERGE_HEAD
|
||||||
|
* - all references stored inside of "refs/bisect/"
|
||||||
|
*/
|
||||||
static bool is_per_worktree_ref(const char *ref_name)
|
static bool is_per_worktree_ref(const char *ref_name)
|
||||||
{
|
{
|
||||||
return strcmp("HEAD", ref_name) == 0 ||
|
return git__prefixcmp(ref_name, "refs/") != 0 ||
|
||||||
strcmp("FETCH_HEAD", ref_name) == 0 ||
|
git__prefixcmp(ref_name, "refs/bisect/") == 0;
|
||||||
strcmp("MERGE_HEAD", ref_name) == 0 ||
|
|
||||||
strcmp("ORIG_HEAD", ref_name) == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int loose_lookup(
|
static int loose_lookup(
|
||||||
|
Loading…
Reference in New Issue
Block a user