Skip to content

Commit 0cd58d8

Browse files
committed
Merge branch 'nd/submodule-status-fix'
"git submodule status" did not check the symbolic revision name it computed for the submodule HEAD is not the NULL, and threw it at printf routines, which has been corrected. * nd/submodule-status-fix: submodule--helper: don't print null in 'submodule status'
2 parents 0657e0f + 0b5e2ea commit 0cd58d8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

builtin/submodule--helper.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,12 @@ static void print_status(unsigned int flags, char state, const char *path,
596596

597597
printf("%c%s %s", state, oid_to_hex(oid), displaypath);
598598

599-
if (state == ' ' || state == '+')
600-
printf(" (%s)", compute_rev_name(path, oid_to_hex(oid)));
599+
if (state == ' ' || state == '+') {
600+
const char *name = compute_rev_name(path, oid_to_hex(oid));
601+
602+
if (name)
603+
printf(" (%s)", name);
604+
}
601605

602606
printf("\n");
603607
}

0 commit comments

Comments
 (0)