diff options
Diffstat (limited to 'walker.c')
-rw-r--r-- | walker.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -59,6 +59,7 @@ static int process_tree(struct walker *walker, struct tree *tree) free(tree->buffer); tree->buffer = NULL; tree->size = 0; + tree->object.parsed = 0; return 0; } @@ -190,9 +191,13 @@ 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_from_str(target); + if (!walker->fetch_ref(walker, ref)) { + hashcpy(sha1, ref->old_sha1); + free(ref); return 0; } + free(ref); } return -1; } |