From: Bruno Haible Date: Mon, 18 Feb 2008 02:36:33 +0000 (+0100) Subject: Avoid generating no-op conflicts. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea180b80e8ba9da7bce84c12175343b964363688;p=pspp Avoid generating no-op conflicts. --- diff --git a/ChangeLog b/ChangeLog index 437e4a1110..386eaf593c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-17 Bruno Haible + + * lib/git-merge-changelog.c (main) [split_merged_entry]: Avoid + generating no-op conflicts. + 2008-02-17 Bruno Haible Speed up by 10%. diff --git a/lib/git-merge-changelog.c b/lib/git-merge-changelog.c index 56e5511024..1911c08e5c 100644 --- a/lib/git-merge-changelog.c +++ b/lib/git-merge-changelog.c @@ -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 *);