From efbd4fdfc9978bf3872ca8cf390da4ffa3480188 Mon Sep 17 00:00:00 2001 From: René Scharfe 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 --- ref-filter.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'ref-filter.c') diff --git a/ref-filter.c b/ref-filter.c index bc591f4f3d..55323620ab 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -295,9 +295,7 @@ static void if_atom_parser(const struct ref_format *format, struct used_atom *at static void head_atom_parser(const struct ref_format *format, struct used_atom *atom, const char *arg) { - struct object_id unused; - - atom->u.head = resolve_refdup("HEAD", RESOLVE_REF_READING, unused.hash, NULL); + atom->u.head = resolve_refdup("HEAD", RESOLVE_REF_READING, NULL, NULL); } static struct { @@ -1317,9 +1315,8 @@ static void populate_value(struct ref_array_item *ref) ref->value = xcalloc(used_atom_cnt, sizeof(struct atom_value)); if (need_symref && (ref->flag & REF_ISSYMREF) && !ref->symref) { - struct object_id unused1; ref->symref = resolve_refdup(ref->refname, RESOLVE_REF_READING, - unused1.hash, NULL); + NULL, NULL); if (!ref->symref) ref->symref = ""; } -- cgit v1.3