Thread (4 messages) flat view 4 messages, 4 authors, 2016-06-15
DORMANTno replies

[PATCH] Fix describe --tags --long so it does not segfault

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:44:53
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
Backtraced-by: Mikael Magnusson [off-list ref]
Signed-off-by: Shawn O. Pearce <redacted>
---

 Thanks Mikael, the backtrace really made it easy to figure out
 what the breakage was here.

 builtin-describe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-describe.c b/builtin-describe.c
index 3da99c1..e515f9c 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;
 	}
-- 
1.5.6.74.g8a5e
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help