diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2008-07-03 02:32:45 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-02 21:21:59 -0700 |
commit | 14d4642e2a472ba4c06e10a3f5623d944b869314 (patch) | |
tree | f19a9f78bc6a56bcc7bb64498277217103e171ba /builtin-describe.c | |
parent | 7ad0f27b925463c5ca6908573ed24ede11a9981f (diff) | |
download | git-14d4642e2a472ba4c06e10a3f5623d944b869314.tar.gz |
Fix describe --tags --long so it does not segfault
If we match a lightweight (non-annotated tag) as the name to
output and --long was requested we do not have a tag, nor do
we have a tagged object to display. Instead we must use the
object we were passed as input for the long format display.
Reported-by: Mark Burton <markb@ordern.com>
Backtraced-by: Mikael Magnusson <mikachu@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-describe.c')
-rw-r--r-- | builtin-describe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-describe.c b/builtin-describe.c index 3da99c1d06..e515f9ca9b 100644 --- a/builtin-describe.c +++ b/builtin-describe.c @@ -204,7 +204,7 @@ static void describe(const char *arg, int last_one) */ display_name(n); if (longformat) - show_suffix(0, n->tag->tagged->sha1); + show_suffix(0, n->tag ? n->tag->tagged->sha1 : sha1); printf("\n"); return; } |