merge-ort: miscellaneous touch-ups
Add some notes in the code about invariants with match_mask when adding pairs. Also add a comment that seems to have been left out in my work of pushing these changes upstream. Signed-off-by: Elijah Newren <newren@gmail.com> Reviewed-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Jun 8, 2021 at 16:11 UTC
ef68c3d800b9c4516f1a13038e047610882cd26f
1 file changed
+5
merge-ort.c
+5
@@ -764,6 +764,7 @@ static void add_pair(struct merge_options *opt,
764
int names_idx = is_add ? side : 0;
765
766
if (is_add) {
767
+ assert(match_mask == 0 || match_mask == 6);
768
if (strset_contains(&renames->cached_target_names[side],
769
pathname))
770
return;
@@ -771,6 +772,8 @@ static void add_pair(struct merge_options *opt,
772
unsigned content_relevant = (match_mask == 0);
773
unsigned location_relevant = (dir_rename_mask == 0x07);
774
775
+ assert(match_mask == 0 || match_mask == 3 || match_mask == 5);
776
+
777
/*
778
* If pathname is found in cached_irrelevant[side] due to
779
* previous pick but for this commit content is relevant,
@@ -3485,6 +3488,8 @@ static void process_entry(struct merge_options *opt,
3488
*/
3489
if (!ci->merged.clean)
3490
strmap_put(&opt->priv->conflicted, path, ci);
3491
+
3492
+ /* Record metadata for ci->merged in dir_metadata */
3493
record_entry_for_tree(dir_metadata, path, &ci->merged);
3494
}
3495