Avoid generating no-op conflicts.
authorBruno Haible <bruno@clisp.org>
Mon, 18 Feb 2008 02:36:33 +0000 (03:36 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 18 Feb 2008 02:36:33 +0000 (03:36 +0100)
ChangeLog
lib/git-merge-changelog.c

index 437e4a1..386eaf5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-02-17  Bruno Haible  <bruno@clisp.org>
 
+       * lib/git-merge-changelog.c (main) [split_merged_entry]: Avoid
+       generating no-op conflicts.
+
+2008-02-17  Bruno Haible  <bruno@clisp.org>
+
        Speed up by 10%.
        * lib/git-merge-changelog.c (main): Use the iterator to iterate through
        result_entries, rather than an index-based loop.
index 56e5511..1911c08 100644 (file)
@@ -1257,7 +1257,8 @@ There is NO WARRANTY, to the extent permitted by law.\n\
                                                            result_entries_pointers[k],
                                                            changed_entry);
                                  }
-                               else
+                               else if (!entry_equals (ancestor_file.entries[i],
+                                                       changed_entry))
                                  {
                                    struct conflict *c = XMALLOC (struct conflict);
                                    c->num_old_entries = 1;
@@ -1337,7 +1338,10 @@ There is NO WARRANTY, to the extent permitted by law.\n\
                                  }
                                else
                                  {
-                                   struct conflict *c = XMALLOC (struct conflict);
+                                   struct conflict *c;
+                                   ASSERT (!entry_equals (ancestor_file.entries[i],
+                                                          changed_entry));
+                                   c = XMALLOC (struct conflict);
                                    c->num_old_entries = 1;
                                    c->old_entries =
                                      XNMALLOC (c->num_old_entries, struct entry *);
@@ -1399,7 +1403,10 @@ There is NO WARRANTY, to the extent permitted by law.\n\
                                      }
                                    else
                                      {
-                                       struct conflict *c = XMALLOC (struct conflict);
+                                       struct conflict *c;
+                                       ASSERT (!entry_equals (ancestor_file.entries[i],
+                                                              changed_entry));
+                                       c = XMALLOC (struct conflict);
                                        c->num_old_entries = 1;
                                        c->old_entries =
                                          XNMALLOC (c->num_old_entries, struct entry *);