diff options
author | René Scharfe <l.s.r@web.de> | 2017-10-01 09:29:03 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-01 17:27:14 +0900 |
commit | efbd4fdfc9978bf3872ca8cf390da4ffa3480188 (patch) | |
tree | b3e8b62af87e612724c2b4a95dc2cbf1c94f6e90 /builtin/checkout.c | |
parent | 872ccb2c69ce44abb198efa1013dd4e0887a7495 (diff) | |
download | git-efbd4fdfc9978bf3872ca8cf390da4ffa3480188.tar.gz |
refs: pass NULL to resolve_refdup() if hash is not neededrs/resolve-ref-optional-result
This allows us to get rid of several write-only variables.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 5c202b7af5..531f7720f3 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1116,9 +1116,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); |