]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/submodule--helper.c
Merge branch 'nd/submodule-status-fix'
[thirdparty/git.git] / builtin / submodule--helper.c
index 7586f776fe3cf2140c86f1f1842389f186929201..c2403a915ffe29e152832ae16e5bc902703a9903 100644 (file)
@@ -596,8 +596,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");
 }