summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorLibravatar Elijah Newren <newren@gmail.com>2018-08-29 00:06:12 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-08-30 07:58:59 -0700
commit5fdddd9b757a50c9a583936e7e6e44ec96d2d651 (patch)
treeccfdb42370b3238335013c190cfd58154bc4c95e /merge-recursive.c
parentt3401: add another directory rename testcase for rebase and am (diff)
downloadtgif-5fdddd9b757a50c9a583936e7e6e44ec96d2d651.tar.xz
merge-recursive: add ability to turn off directory rename detection
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index f110e1c5ec..bf3cb03d3a 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -2843,12 +2843,19 @@ static int handle_renames(struct merge_options *o,
head_pairs = get_diffpairs(o, common, head);
merge_pairs = get_diffpairs(o, common, merge);
- dir_re_head = get_directory_renames(head_pairs, head);
- dir_re_merge = get_directory_renames(merge_pairs, merge);
+ if (o->detect_directory_renames) {
+ dir_re_head = get_directory_renames(head_pairs, head);
+ dir_re_merge = get_directory_renames(merge_pairs, merge);
- handle_directory_level_conflicts(o,
- dir_re_head, head,
- dir_re_merge, merge);
+ handle_directory_level_conflicts(o,
+ dir_re_head, head,
+ dir_re_merge, merge);
+ } else {
+ dir_re_head = xmalloc(sizeof(*dir_re_head));
+ dir_re_merge = xmalloc(sizeof(*dir_re_merge));
+ dir_rename_init(dir_re_head);
+ dir_rename_init(dir_re_merge);
+ }
ri->head_renames = get_renames(o, head_pairs,
dir_re_merge, dir_re_head, head,
@@ -3541,6 +3548,7 @@ void init_merge_options(struct merge_options *o)
o->renormalize = 0;
o->diff_detect_rename = -1;
o->merge_detect_rename = -1;
+ o->detect_directory_renames = 1;
merge_recursive_config(o);
merge_verbosity = getenv("GIT_MERGE_VERBOSITY");
if (merge_verbosity)