summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/commit.c b/commit.c
index 0bbfa2ab31..caee5bc218 100644
--- a/commit.c
+++ b/commit.c
@@ -52,8 +52,9 @@ struct commit *lookup_commit_reference(const unsigned char *sha1)
if (!obj)
return NULL;
- if (obj->type == tag_type)
- obj = ((struct tag *)obj)->tagged;
+ while (obj->type == tag_type)
+ obj = parse_object(((struct tag *)obj)->tagged->sha1);
+
return check_commit(obj, sha1);
}