diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-05 13:48:19 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-05 13:48:19 +0900 |
commit | efe9d6ce33ed817150f4ff63ebfc14a3f7667eb4 (patch) | |
tree | 445ad62e5235a01002086d2009b35fb9cc16af96 /builtin/checkout.c | |
parent | 29a67ccc89b0f105aa8e6f675649145b88b2cb0e (diff) | |
parent | efbd4fdfc9978bf3872ca8cf390da4ffa3480188 (diff) | |
download | git-efe9d6ce33ed817150f4ff63ebfc14a3f7667eb4.tar.gz |
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
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r-- | builtin/checkout.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 3345a0d16f..10751585ea 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -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); |