Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Thu, 3 Jul 2008 04:57:50 +0000 (21:57 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Jul 2008 04:57:50 +0000 (21:57 -0700)
* maint:
Fix describe --tags --long so it does not segfault

builtin-describe.c
t/t6120-describe.sh
index 3da99c1d06f1eeb85e760036dc881282558603d6..e515f9ca9b5d0ec13e96a7866e27bdd9e852b435 100644 (file)
@@ -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;
        }
index c6be2597f73dbd49e6301d01b5ea3c86ac8c34cb..2fb672c3b43a9efe4cb9c85465f6b33f23724e48 100755 (executable)
@@ -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