X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgit-merge-changelog.c;h=1911c08e5ca78b0932e239548651ada0e1bb09ed;hb=35dda7458879acb367f2cba0aaf7856cd98f5b63;hp=5f639eff0d8a54ae474ad58b4d01a9dbf6f84f0f;hpb=65bd10479d4cb86bab4aea1424c094f8f585000c;p=gnulib.git diff --git a/lib/git-merge-changelog.c b/lib/git-merge-changelog.c index 5f639eff0..1911c08e5 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 *); @@ -1505,11 +1512,14 @@ There is NO WARRANTY, to the extent permitted by law.\n\ for (i = 0; i < n; i++) conflict_write (fp, (struct conflict *) gl_list_get_at (result_conflicts, i)); } + /* Output the modified and unmodified entries, in order. */ { - size_t n = gl_list_size (result_entries); - size_t i; - for (i = 0; i < n; i++) - entry_write (fp, (struct entry *) gl_list_get_at (result_entries, i)); + gl_list_iterator_t iter = gl_list_iterator (result_entries); + const void *elt; + gl_list_node_t node; + while (gl_list_iterator_next (&iter, &elt, &node)) + entry_write (fp, (struct entry *) elt); + gl_list_iterator_free (&iter); } if (fwriteerror (fp))