From efbd4fdfc9978bf3872ca8cf390da4ffa3480188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sun, 1 Oct 2017 09:29:03 +0200 Subject: refs: pass NULL to resolve_refdup() if hash is not needed This allows us to get rid of several write-only variables. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- builtin/checkout.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'builtin/checkout.c') 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); -- cgit v1.2.3