Merge branch 'jn/gitweb-customlinks'
[gitweb.git] / builtin-commit.c
index 93ca49635731942c72cb52b27b1a6ba53becd1ca..591d16b91eab09d89fefecbd058e4bca78439455 100644 (file)
@@ -1015,9 +1015,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);