Skip to content

Commit 112e111

Browse files
newrengitster
authored andcommitted
merge-ort: add outline for computing directory renames
Port some directory rename handling changes from merge-recursive.c's detect_and_process_renames() to the same-named function of merge-ort.c. This does not yet add any use or handling of directory renames, just the outline for where we start to compute them. Thus, a future patch will add port additional changes to merge-ort's detect_and_process_renames(). Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb3e3e1 commit 112e111

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

merge-ort.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,18 @@ static int handle_content_merge(struct merge_options *opt,
721721

722722
/*** Function Grouping: functions related to directory rename detection ***/
723723

724+
static void get_provisional_directory_renames(struct merge_options *opt,
725+
unsigned side,
726+
int *clean)
727+
{
728+
die("Not yet implemented!");
729+
}
730+
731+
static void handle_directory_level_conflicts(struct merge_options *opt)
732+
{
733+
die("Not yet implemented!");
734+
}
735+
724736
/*** Function Grouping: functions related to regular rename detection ***/
725737

726738
static int process_renames(struct merge_options *opt,
@@ -1086,13 +1098,24 @@ static int detect_and_process_renames(struct merge_options *opt,
10861098
{
10871099
struct diff_queue_struct combined;
10881100
struct rename_info *renames = &opt->priv->renames;
1089-
int s, clean = 1;
1101+
int need_dir_renames, s, clean = 1;
10901102

10911103
memset(&combined, 0, sizeof(combined));
10921104

10931105
detect_regular_renames(opt, merge_base, side1, MERGE_SIDE1);
10941106
detect_regular_renames(opt, merge_base, side2, MERGE_SIDE2);
10951107

1108+
need_dir_renames =
1109+
!opt->priv->call_depth &&
1110+
(opt->detect_directory_renames == MERGE_DIRECTORY_RENAMES_TRUE ||
1111+
opt->detect_directory_renames == MERGE_DIRECTORY_RENAMES_CONFLICT);
1112+
1113+
if (need_dir_renames) {
1114+
get_provisional_directory_renames(opt, MERGE_SIDE1, &clean);
1115+
get_provisional_directory_renames(opt, MERGE_SIDE2, &clean);
1116+
handle_directory_level_conflicts(opt);
1117+
}
1118+
10961119
ALLOC_GROW(combined.queue,
10971120
renames->pairs[1].nr + renames->pairs[2].nr,
10981121
combined.alloc);

0 commit comments

Comments
 (0)