Skip to content

Commit dcf2815

Browse files
newrengitster
authored andcommitted
merge-recursive: use handle_file_collision for add/add conflicts
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bbafc9c commit dcf2815

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

merge-recursive.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,14 +3355,27 @@ static int process_entry(struct merge_options *o,
33553355
clean_merge = -1;
33563356
}
33573357
} else if (a_oid && b_oid) {
3358-
/* Case C: Added in both (check for same permissions) and */
3359-
/* case D: Modified in both, but differently. */
3360-
int is_dirty = 0; /* unpack_trees would have bailed if dirty */
3361-
clean_merge = handle_content_merge(o, path, is_dirty,
3362-
o_oid, o_mode,
3363-
a_oid, a_mode,
3364-
b_oid, b_mode,
3365-
NULL);
3358+
if (!o_oid) {
3359+
/* Case C: Added in both (check for same permissions) */
3360+
output(o, 1,
3361+
_("CONFLICT (add/add): Merge conflict in %s"),
3362+
path);
3363+
clean_merge = handle_file_collision(o,
3364+
path, NULL, NULL,
3365+
o->branch1,
3366+
o->branch2,
3367+
a_oid, a_mode,
3368+
b_oid, b_mode);
3369+
} else {
3370+
/* case D: Modified in both, but differently. */
3371+
int is_dirty = 0; /* unpack_trees would have bailed if dirty */
3372+
clean_merge = handle_content_merge(o, path,
3373+
is_dirty,
3374+
o_oid, o_mode,
3375+
a_oid, a_mode,
3376+
b_oid, b_mode,
3377+
NULL);
3378+
}
33663379
} else if (!o_oid && !a_oid && !b_oid) {
33673380
/*
33683381
* this entry was deleted altogether. a_mode == 0 means

0 commit comments

Comments
 (0)