mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-01 15:53:15 +00:00
worktree: use fully qualified reference name for created HEAD
When creating a new worktree, we have to set up the initial data structures. Next to others, this also includes the HEAD pseudo-ref. We currently set it to the worktree respectively branch name, which is actually not fully qualified. Use the fully qualified branch name instead.
This commit is contained in:
parent
20a368e2d7
commit
9dcc79bc6a
@ -323,7 +323,7 @@ int git_worktree_add(git_worktree **out, git_repository *repo, const char *name,
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* Set worktree's HEAD */
|
/* Set worktree's HEAD */
|
||||||
if ((err = git_repository_create_head(path.ptr, name)) < 0)
|
if ((err = git_repository_create_head(path.ptr, git_reference_name(ref))) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
if ((err = git_repository_open(&wt, worktree)) < 0)
|
if ((err = git_repository_open(&wt, worktree)) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user