[PATCH 2/6] git-show: When showing tag objects with no tag name, show tag object's SHA1 instead of an empty string
This is a consequence of making the "tag" header in tag objects optional.
Signed-off-by: Johan Herland <johan@herland.net>
---
builtin-log.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index 3744712..1a0f111 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -181,7 +181,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
printf("%stag %s%s\n\n",
diff_get_color(rev.diffopt.color_diff,
DIFF_COMMIT),
- t->tag,
+ *(t->tag) ? t->tag : name,
diff_get_color(rev.diffopt.color_diff,
DIFF_RESET));
ret = show_object(o->sha1, 1);
--
1.5.2