diff options
author | Martin Koegler <mkoegler@auto.tuwien.ac.at> | 2008-02-18 21:48:01 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-18 19:25:26 -0800 |
commit | 9684afd967f61047bbf1b3a8039adf7d41916b31 (patch) | |
tree | 453fc14601cf7a6b0e28e451db1e7f9557a5ba21 /revision.c | |
parent | f7de5a56b75109e1d6651ee2b5bf7f496a5eb18b (diff) | |
download | git-9684afd967f61047bbf1b3a8039adf7d41916b31.tar.gz git-9684afd967f61047bbf1b3a8039adf7d41916b31.tar.xz |
revision.c: handle tag->tagged == NULL
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/revision.c b/revision.c index 484e5e795..b1aebf899 100644 --- a/revision.c +++ b/revision.c @@ -177,6 +177,8 @@ static struct commit *handle_commit(struct rev_info *revs, struct object *object struct tag *tag = (struct tag *) object; if (revs->tag_objects && !(flags & UNINTERESTING)) add_pending_object(revs, object, tag->tag); + if (!tag->tagged) + die("bad tag"); object = parse_object(tag->tagged->sha1); if (!object) die("bad object %s", sha1_to_hex(tag->tagged->sha1)); @@ -689,6 +691,8 @@ static int add_parents_only(struct rev_info *revs, const char *arg, int flags) it = get_reference(revs, arg, sha1, 0); if (it->type != OBJ_TAG) break; + if (!((struct tag*)it)->tagged) + return 0; hashcpy(sha1, ((struct tag*)it)->tagged->sha1); } if (it->type != OBJ_COMMIT) |