Merge branch 'rs/resolve-ref-optional-result'
Code clean-up. * rs/resolve-ref-optional-result: refs: pass NULL to resolve_refdup() if hash is not needed refs: pass NULL to refs_resolve_refdup() if hash is not needed
This commit is contained in:
@ -1124,9 +1124,8 @@ static int checkout_branch(struct checkout_opts *opts,
|
||||
|
||||
if (new->path && !opts->force_detach && !opts->new_branch &&
|
||||
!opts->ignore_other_worktrees) {
|
||||
struct object_id oid;
|
||||
int flag;
|
||||
char *head_ref = resolve_refdup("HEAD", 0, oid.hash, &flag);
|
||||
char *head_ref = resolve_refdup("HEAD", 0, NULL, &flag);
|
||||
if (head_ref &&
|
||||
(!(flag & REF_ISSYMREF) || strcmp(head_ref, new->path)))
|
||||
die_if_checked_out(new->path, 1);
|
||||
|
Reference in New Issue
Block a user