[PATCH] Update the spec file so it can build and install the documentation
[git.git] / commit.c
index 0bbfa2a..caee5bc 100644 (file)
--- 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);
 }