diff options
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r-- | builtin/submodule--helper.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index a4193c01d9..d85b29b49e 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -562,8 +562,12 @@ static void print_status(unsigned int flags, char state, const char *path, printf("%c%s %s", state, oid_to_hex(oid), displaypath); - if (state == ' ' || state == '+') - printf(" (%s)", compute_rev_name(path, oid_to_hex(oid))); + if (state == ' ' || state == '+') { + const char *name = compute_rev_name(path, oid_to_hex(oid)); + + if (name) + printf(" (%s)", name); + } printf("\n"); } |