From 744c040b19412fa5075810eb1aced105fad96726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 23 Sep 2017 11:45:04 +0200 Subject: refs: pass NULL to resolve_ref_unsafe() if hash is not needed This allows us to get rid of some write-only variables, among them seven SHA1 buffers. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- builtin/commit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'builtin/commit.c') diff --git a/builtin/commit.c b/builtin/commit.c index 58f9747c2f..39d5b7f6c7 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1431,7 +1431,6 @@ static void print_summary(const char *prefix, const struct object_id *oid, struct rev_info rev; struct commit *commit; struct strbuf format = STRBUF_INIT; - struct object_id junk_oid; const char *head; struct pretty_print_context pctx = {0}; struct strbuf author_ident = STRBUF_INIT; @@ -1484,7 +1483,7 @@ static void print_summary(const char *prefix, const struct object_id *oid, rev.diffopt.break_opt = 0; diff_setup_done(&rev.diffopt); - head = resolve_ref_unsafe("HEAD", 0, junk_oid.hash, NULL); + head = resolve_ref_unsafe("HEAD", 0, NULL, NULL); if (!strcmp(head, "HEAD")) head = _("detached HEAD"); else -- cgit v1.2.3