summaryrefslogtreecommitdiff
path: root/walker.c
diff options
context:
space:
mode:
Diffstat (limited to 'walker.c')
-rw-r--r--walker.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/walker.c b/walker.c
index c10eca8826..fa96a7c7d2 100644
--- a/walker.c
+++ b/walker.c
@@ -190,9 +190,14 @@ static int interpret_target(struct walker *walker, char *target, unsigned char *
if (!get_sha1_hex(target, sha1))
return 0;
if (!check_ref_format(target)) {
- if (!walker->fetch_ref(walker, target, sha1)) {
+ struct ref *ref = alloc_ref(strlen(target));
+ strcpy(ref->name, target);
+ if (!walker->fetch_ref(walker, ref)) {
+ hashcpy(sha1, ref->old_sha1);
+ free(ref);
return 0;
}
+ free(ref);
}
return -1;
}