aboutsummaryrefslogtreecommitdiff
path: root/rev-list.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-07-10 23:55:56 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-11 10:13:09 -0700
commit013aab8265a806c8d3c9b040485839091bca30f4 (patch)
treee75e5d1030d60d7dfbde5c7f29132a92ec965836 /rev-list.c
parenta3eb250f996bf5e12376ec88622c4ccaabf20ea8 (diff)
downloadgit-013aab8265a806c8d3c9b040485839091bca30f4.tar.gz
git-013aab8265a806c8d3c9b040485839091bca30f4.tar.xz
[PATCH] Dereference tag repeatedly until we get a non-tag.
When we allow a tag object in place of a commit object, we only dereferenced the given tag once, which causes a tag that points at a tag that points at a commit to be rejected. Instead, dereference tag repeatedly until we get a non-tag. This patch makes change to two functions: - commit.c::lookup_commit_reference() is used by merge-base, rev-tree and rev-parse to convert user supplied SHA1 to that of a commit. - rev-list uses its own get_commit_reference() to do the same. Dereferencing tags this way helps both of these uses. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'rev-list.c')
-rw-r--r--rev-list.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rev-list.c b/rev-list.c
index 0c0bdc2fd..fdb531caf 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);
}
/*