summaryrefslogtreecommitdiff
path: root/builtin-show-ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-show-ref.c')
-rw-r--r--builtin-show-ref.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-show-ref.c b/builtin-show-ref.c
index 9ae3d08546..073979855b 100644
--- a/builtin-show-ref.c
+++ b/builtin-show-ref.c
@@ -67,8 +67,10 @@ match:
return 0;
if ((flag & REF_ISPACKED) && !peel_ref(refname, peeled)) {
- hex = find_unique_abbrev(peeled, abbrev);
- printf("%s %s^{}\n", hex, refname);
+ if (!is_null_sha1(peeled)) {
+ hex = find_unique_abbrev(peeled, abbrev);
+ printf("%s %s^{}\n", hex, refname);
+ }
}
else {
obj = parse_object(sha1);