X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-show-ref.c;h=a323633e296cef1797ab1d218cea83c891bc3b8d;hb=803d5158123346229d71de53818920efbc88ca0f;hp=9463ff0e69b15fc0e544259e64960bc942a98368;hpb=f8db7884286232274c8e7c7d82a35a2478b097d3;p=git.git diff --git a/builtin-show-ref.c b/builtin-show-ref.c index 9463ff0e6..a323633e2 100644 --- a/builtin-show-ref.c +++ b/builtin-show-ref.c @@ -1,3 +1,4 @@ +#include "builtin.h" #include "cache.h" #include "refs.h" #include "object.h" @@ -85,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); }