]> git.ipfire.org Git - thirdparty/git.git/commitdiff
merge-recursive: use handle_file_collision for add/add conflicts
authorElijah Newren <newren@gmail.com>
Thu, 8 Nov 2018 04:40:28 +0000 (20:40 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Nov 2018 05:23:53 +0000 (14:23 +0900)
This results in no-net change of behavior, it simply ensures that all
file-collision conflict handling types are being handled the same by
calling the same function.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c

index ead6054a75b6bd6317f2162661d6122c2fa853f7..c78b347112c09252a38f69182bf7da19304c08d4 100644 (file)
@@ -3355,14 +3355,27 @@ static int process_entry(struct merge_options *o,
                                clean_merge = -1;
                }
        } else if (a_oid && b_oid) {
-               /* Case C: Added in both (check for same permissions) and */
-               /* case D: Modified in both, but differently. */
-               int is_dirty = 0; /* unpack_trees would have bailed if dirty */
-               clean_merge = handle_content_merge(o, path, is_dirty,
-                                                  o_oid, o_mode,
-                                                  a_oid, a_mode,
-                                                  b_oid, b_mode,
-                                                  NULL);
+               if (!o_oid) {
+                       /* Case C: Added in both (check for same permissions) */
+                       output(o, 1,
+                              _("CONFLICT (add/add): Merge conflict in %s"),
+                              path);
+                       clean_merge = handle_file_collision(o,
+                                                           path, NULL, NULL,
+                                                           o->branch1,
+                                                           o->branch2,
+                                                           a_oid, a_mode,
+                                                           b_oid, b_mode);
+               } else {
+                       /* case D: Modified in both, but differently. */
+                       int is_dirty = 0; /* unpack_trees would have bailed if dirty */
+                       clean_merge = handle_content_merge(o, path,
+                                                          is_dirty,
+                                                          o_oid, o_mode,
+                                                          a_oid, a_mode,
+                                                          b_oid, b_mode,
+                                                          NULL);
+               }
        } else if (!o_oid && !a_oid && !b_oid) {
                /*
                 * this entry was deleted altogether. a_mode == 0 means