t5516: remove ambiguity test (1)
[gitweb.git] / builtin-fmt-merge-msg.c
index 8a3c962f8920bb883287053c850adf78312ff19b..03c2bc33ebdc47c9f5d79f07aae833c3720a077d 100644 (file)
@@ -176,7 +176,7 @@ static void shortlog(const char *name, unsigned char *sha1,
        struct commit *commit;
        struct object *branch;
        struct list subjects = { NULL, NULL, 0, 0 };
-       int flags = UNINTERESTING | TREECHANGE | SEEN | SHOWN | ADDED;
+       int flags = UNINTERESTING | TREESAME | SEEN | SHOWN | ADDED;
 
        branch = deref_tag(parse_object(sha1), sha1_to_hex(sha1), 40);
        if (!branch || branch->type != OBJ_COMMIT)
@@ -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);