Skip to content

Commit 7d3580d

Browse files
committed
Merge branch 'maint'
* maint: Fix describe --tags --long so it does not segfault
2 parents 8cb560f + 182c5af commit 7d3580d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

builtin-describe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static void describe(const char *arg, int last_one)
204204
*/
205205
display_name(n);
206206
if (longformat)
207-
show_suffix(0, n->tag->tagged->sha1);
207+
show_suffix(0, n->tag ? n->tag->tagged->sha1 : sha1);
208208
printf("\n");
209209
return;
210210
}

t/t6120-describe.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,6 @@ check_describe "test1-lightweight-*" --tags --match="test1-*"
139139

140140
check_describe "test2-lightweight-*" --tags --match="test2-*"
141141

142+
check_describe "test2-lightweight-*" --long --tags --match="test2-*" HEAD^
143+
142144
test_done

0 commit comments

Comments
 (0)