diff options
-rw-r--r-- | commit.c | 5 | ||||
-rw-r--r-- | rev-list.c | 4 |
2 files changed, 5 insertions, 4 deletions
@@ -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); } diff --git a/rev-list.c b/rev-list.c index 0c0bdc2fd8..fdb531caf6 100644 --- a/rev-list.c +++ b/rev-list.c @@ -367,12 +367,12 @@ static struct commit *get_commit_reference(const char *name, unsigned int flags) /* * Tag object? Look what it points to.. */ - if (object->type == tag_type) { + while (object->type == tag_type) { struct tag *tag = (struct tag *) object; object->flags |= flags; if (tag_objects && !(object->flags & UNINTERESTING)) add_pending_object(object, tag->tag); - object = tag->tagged; + object = parse_object(tag->tagged->sha1); } /* |