summaryrefslogtreecommitdiff
path: root/builtin-show-ref.c
diff options
context:
space:
mode:
authorMartin Koegler <mkoegler@auto.tuwien.ac.at>2008-02-18 08:31:54 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-17 23:46:55 -0800
commitaffeef12fb2d10317fbcc7a866fbc3603cf16119 (patch)
tree61ce1a23d8259dc7f90778c7a0fd1b8898a7aa50 /builtin-show-ref.c
parent9886ea417b7da9722c95630b5980ac174e04c71c (diff)
downloadgit-affeef12fb2d10317fbcc7a866fbc3603cf16119.tar.gz
deref_tag: handle return value NULL
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-show-ref.c')
-rw-r--r--builtin-show-ref.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin-show-ref.c b/builtin-show-ref.c
index 65051d14fd..a323633e29 100644
--- a/builtin-show-ref.c
+++ b/builtin-show-ref.c
@@ -86,6 +86,9 @@ match:
sha1_to_hex(sha1));
if (obj->type == OBJ_TAG) {
obj = deref_tag(obj, refname, 0);
+ if (!obj)
+ die("git-show-ref: bad tag at ref %s (%s)", refname,
+ sha1_to_hex(sha1));
hex = find_unique_abbrev(obj->sha1, abbrev);
printf("%s %s^{}\n", hex, refname);
}