diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-09-20 15:20:44 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-20 15:20:45 -0700 |
commit | a16dd1374023d1a5f6ee7c48661e0ed53a954391 (patch) | |
tree | 73d6f7e3c1f5ae4ad74cfc76b88002625f948c3f /sequencer.c | |
parent | dc89c34d9e9237293d0ed73adc454fedfc620f74 (diff) | |
parent | 516680ba7704c473bb21628aa19cabbd787df4db (diff) |
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 'sequencer.c')
-rw-r--r-- | sequencer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c index 6831663692..614d56f5e2 100644 --- a/sequencer.c +++ b/sequencer.c @@ -664,6 +664,7 @@ static int do_recursive_merge(struct repository *r, merge_switch_to_result(&o, head_tree, &result, 1, show_output); clean = result.clean; } else { + ensure_full_index(r->index); clean = merge_trees(&o, head_tree, next_tree, base_tree); if (is_rebase_i(opts) && clean <= 0) fputs(o.obuf.buf, stdout); @@ -2359,6 +2360,7 @@ static int read_and_refresh_cache(struct repository *r, _(action_name(opts))); } refresh_index(r->index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL); + if (index_fd >= 0) { if (write_locked_index(r->index, &index_lock, COMMIT_LOCK | SKIP_IF_UNCHANGED)) { @@ -2366,6 +2368,13 @@ static int read_and_refresh_cache(struct repository *r, _(action_name(opts))); } } + + /* + * If we are resolving merges in any way other than "ort", then + * expand the sparse index. + */ + if (opts->strategy && strcmp(opts->strategy, "ort")) + ensure_full_index(r->index); return 0; } |