summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-02 21:57:50 -0700
committerJunio C Hamano <gitster@pobox.com>2008-07-02 21:57:50 -0700
commit7d3580d74c6d801419dd91416f9a81750b7d4e2c (patch)
tree2f802f5c45b46f882fe1e975c43ee7bf0858eb3b
parent8cb560fc470ee0d94e188d4e9deb14b0c8ac7a91 (diff)
parent182c5afa6c00eb8b773fc062bfd2c29f27ea546b (diff)
downloadgit-7d3580d74c6d801419dd91416f9a81750b7d4e2c.tar.gz
Merge branch 'maint'
* maint: Fix describe --tags --long so it does not segfault
-rw-r--r--builtin-describe.c2
-rwxr-xr-xt/t6120-describe.sh2
2 files changed, 3 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;
}
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index c6be2597f7..2fb672c3b4 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -139,4 +139,6 @@ check_describe "test1-lightweight-*" --tags --match="test1-*"
check_describe "test2-lightweight-*" --tags --match="test2-*"
+check_describe "test2-lightweight-*" --long --tags --match="test2-*" HEAD^
+
test_done