summaryrefslogtreecommitdiff
path: root/reflog-walk.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-10-01 07:29:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-01 08:27:14 (GMT)
commitefbd4fdfc9978bf3872ca8cf390da4ffa3480188 (patch)
treeb3e8b62af87e612724c2b4a95dc2cbf1c94f6e90 /reflog-walk.c
parent872ccb2c69ce44abb198efa1013dd4e0887a7495 (diff)
downloadgit-efbd4fdfc9978bf3872ca8cf390da4ffa3480188.zip
git-efbd4fdfc9978bf3872ca8cf390da4ffa3480188.tar.gz
git-efbd4fdfc9978bf3872ca8cf390da4ffa3480188.tar.bz2
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 <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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/reflog-walk.c b/reflog-walk.c
index 74ebe51..842b2f7 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");