summaryrefslogtreecommitdiff
path: root/ref-filter.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-10-01 09:29:03 +0200
committerJunio C Hamano <gitster@pobox.com>2017-10-01 17:27:14 +0900
commitefbd4fdfc9978bf3872ca8cf390da4ffa3480188 (patch)
treeb3e8b62af87e612724c2b4a95dc2cbf1c94f6e90 /ref-filter.c
parent872ccb2c69ce44abb198efa1013dd4e0887a7495 (diff)
downloadgit-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 'ref-filter.c')
-rw-r--r--ref-filter.c7
1 files changed, 2 insertions, 5 deletions
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 = "";
}