t5516: remove ambiguity test (1)
[gitweb.git] / builtin-fmt-merge-msg.c
index 6163bd4975e3e361e36ffc89ea4c91d0edd02949..03c2bc33ebdc47c9f5d79f07aae833c3720a077d 100644 (file)
@@ -200,6 +200,15 @@ static void shortlog(const char *name, unsigned char *sha1,
                        continue;
 
                bol = strstr(commit->buffer, "\n\n");
+               if (bol) {
+                       unsigned char c;
+                       do {
+                               c = *++bol;
+                       } while (isspace(c));
+                       if (!c)
+                               bol = NULL;
+               }
+
                if (!bol) {
                        append_to_list(&subjects, xstrdup(sha1_to_hex(
                                                        commit->object.sha1)),
@@ -207,7 +216,6 @@ static void shortlog(const char *name, unsigned char *sha1,
                        continue;
                }
 
-               bol += 2;
                eol = strchr(bol, '\n');
                if (eol) {
                        oneline = xmemdupz(bol, eol - bol);