aboutsummaryrefslogtreecommitdiffstats
path: root/merge-ort.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-09-20 15:20:44 -0700
committerJunio C Hamano <gitster@pobox.com>2021-09-20 15:20:45 -0700
commita16dd1374023d1a5f6ee7c48661e0ed53a954391 (patch)
tree73d6f7e3c1f5ae4ad74cfc76b88002625f948c3f /merge-ort.c
parentdc89c34d9e9237293d0ed73adc454fedfc620f74 (diff)
parent516680ba7704c473bb21628aa19cabbd787df4db (diff)
downloadgit-a16dd1374023d1a5f6ee7c48661e0ed53a954391.tar.gz
Merge branch 'ds/mergies-with-sparse-index'
Various mergy operations have been prepared to work efficiently with the sparse index. * ds/mergies-with-sparse-index: sparse-index: integrate with cherry-pick and rebase sequencer: ensure full index if not ORT strategy t1092: add cherry-pick, rebase tests merge-ort: expand only for out-of-cone conflicts merge: make sparse-aware with ORT diff: ignore sparse paths in diffstat
Diffstat (limited to 'merge-ort.c')
-rw-r--r--merge-ort.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/merge-ort.c b/merge-ort.c
index 515dc39b7f..35aa979c3a 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -4074,6 +4074,21 @@ static int record_conflicted_index_entries(struct merge_options *opt)
if (strmap_empty(&opt->priv->conflicted))
return 0;
+ /*
+ * We are in a conflicted state. These conflicts might be inside
+ * sparse-directory entries, so check if any entries are outside
+ * of the sparse-checkout cone preemptively.
+ *
+ * We set original_cache_nr below, but that might change if
+ * index_name_pos() calls ask for paths within sparse directories.
+ */
+ strmap_for_each_entry(&opt->priv->conflicted, &iter, e) {
+ if (!path_in_sparse_checkout(e->key, index)) {
+ ensure_full_index(index);
+ break;
+ }
+ }
+
/* If any entries have skip_worktree set, we'll have to check 'em out */
state.force = 1;
state.quiet = 1;