]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-commit.c
fast-import: close pack before unlinking it
[thirdparty/git.git] / builtin-commit.c
index b563a0d67cedc66825692863d9e57001fba35348..1e08399919fb40f710236d223c12528648e6f40a 100644 (file)
@@ -1004,9 +1004,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
        }
 
        /* Truncate the message just before the diff, if any. */
-       p = strstr(sb.buf, "\ndiff --git a/");
-       if (p != NULL)
-               strbuf_setlen(&sb, p - sb.buf + 1);
+       if (verbose) {
+               p = strstr(sb.buf, "\ndiff --git ");
+               if (p != NULL)
+                       strbuf_setlen(&sb, p - sb.buf + 1);
+       }
 
        if (cleanup_mode != CLEANUP_NONE)
                stripspace(&sb, cleanup_mode == CLEANUP_ALL);