merge-ort: add basic data structures for handling renames
This will grow later, but we only need a few fields for basic rename handling. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Dec 14, 2020 at 16:21 UTC
864075ec433644e5908589fe79f8b3296f896867
1 file changed
+24
merge-ort.c
+24
@@ -46,6 +46,25 @@ enum merge_side {
46
MERGE_SIDE2 = 2
47
};
48
49
+struct rename_info {
50
+ /*
51
+ * pairs: pairing of filenames from diffcore_rename()
52
+ *
53
+ * Index 1 and 2 correspond to sides 1 & 2 as used in
54
+ * conflict_info.stages. Index 0 unused.
55
+ */
56
+ struct diff_queue_struct pairs[3];
57
+
58
+ /*
59
+ * needed_limit: value needed for inexact rename detection to run
60
+ *
61
+ * If the current rename limit wasn't high enough for inexact
62
+ * rename detection to run, this records the limit needed. Otherwise,
63
+ * this value remains 0.
64
+ */
65
+ int needed_limit;
66
+};
67
+
68
struct merge_options_internal {
69
/*
70
* paths: primary data structure in all of merge ort.
@@ -113,6 +132,11 @@ struct merge_options_internal {
132
*/
133
struct strmap output;
134
135
+ /*
136
+ * renames: various data relating to rename detection
137
+ */
138
+ struct rename_info renames;
139
+
140
/*
141
* current_dir_name: temporary var used in collect_merge_info_callback()
142
*