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 /reflog-walk.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 'reflog-walk.c')
-rw-r--r-- | reflog-walk.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/reflog-walk.c b/reflog-walk.c index 74ebe5148f..842b2f77dc 100644 --- a/reflog-walk.c +++ b/reflog-walk.c @@ -61,11 +61,10 @@ static struct complete_reflogs *read_complete_reflog(const char *ref) reflogs->ref = xstrdup(ref); for_each_reflog_ent(ref, read_one_reflog, reflogs); if (reflogs->nr == 0) { - struct object_id oid; const char *name; void *name_to_free; name = name_to_free = resolve_refdup(ref, RESOLVE_REF_READING, - oid.hash, NULL); + NULL, NULL); if (name) { for_each_reflog_ent(name, read_one_reflog, reflogs); free(name_to_free); @@ -151,9 +150,8 @@ int add_reflog_for_walk(struct reflog_walk_info *info, reflogs = item->util; else { if (*branch == '\0') { - struct object_id oid; free(branch); - branch = resolve_refdup("HEAD", 0, oid.hash, NULL); + branch = resolve_refdup("HEAD", 0, NULL, NULL); if (!branch) die ("No current branch"); |