summaryrefslogtreecommitdiff
path: root/merge-ort.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2021-06-08 16:11:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-06-09 02:40:04 (GMT)
commitef68c3d800b9c4516f1a13038e047610882cd26f (patch)
tree64d813b2edb589f37a22f151828e3462101afcc1 /merge-ort.c
parent356da0f98b2c6631b72e69d8638517dd849d28f8 (diff)
downloadgit-ef68c3d800b9c4516f1a13038e047610882cd26f.zip
git-ef68c3d800b9c4516f1a13038e047610882cd26f.tar.gz
git-ef68c3d800b9c4516f1a13038e047610882cd26f.tar.bz2
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>
Diffstat (limited to 'merge-ort.c')
-rw-r--r--merge-ort.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/merge-ort.c b/merge-ort.c
index a3bb3e1..5357174 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -764,6 +764,7 @@ static void add_pair(struct merge_options *opt,
int names_idx = is_add ? side : 0;
if (is_add) {
+ assert(match_mask == 0 || match_mask == 6);
if (strset_contains(&renames->cached_target_names[side],
pathname))
return;
@@ -771,6 +772,8 @@ static void add_pair(struct merge_options *opt,
unsigned content_relevant = (match_mask == 0);
unsigned location_relevant = (dir_rename_mask == 0x07);
+ assert(match_mask == 0 || match_mask == 3 || match_mask == 5);
+
/*
* If pathname is found in cached_irrelevant[side] due to
* previous pick but for this commit content is relevant,
@@ -3485,6 +3488,8 @@ static void process_entry(struct merge_options *opt,
*/
if (!ci->merged.clean)
strmap_put(&opt->priv->conflicted, path, ci);
+
+ /* Record metadata for ci->merged in dir_metadata */
record_entry_for_tree(dir_metadata, path, &ci->merged);
}