diff options
author | Victoria Dye <vdye@github.com> | 2022-03-01 20:24:30 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-01 12:36:01 -0800 |
commit | ab81047a6c5c4f98640f8a2f56e138367cfdada9 (patch) | |
tree | 5d2038e540475bf75cccbf97ef7526f0a3975f4a /t/t4034/dts/expect | |
parent | read-tree: narrow scope of index expansion for '--prefix' (diff) | |
download | tgif-ab81047a6c5c4f98640f8a2f56e138367cfdada9.tar.xz |
read-tree: make two-way merge sparse-aware
Enable two-way merge with 'git read-tree' without expanding the sparse
index. When in a sparse index, a two-way merge will trivially succeed as
long as there are not changes to the same sparse directory in multiple trees
(i.e., sparse directory-level "edit-edit" conflicts). If there are such
conflicts, the merge will fail despite the possibility that individual files
could merge cleanly.
In order to resolve these "edit-edit" conflicts, "conflicted" sparse
directories are - rather than rejected - merged by traversing their
associated trees by OID. For each child of the sparse directory:
1. Files are merged as normal (see Documentation/git-read-tree.txt for
details).
2. Subdirectories are treated as sparse directories and merged in
'twoway_merge'. If there are no conflicts, they are merged according to
the rules in Documentation/git-read-tree.txt; otherwise, the subdirectory
is recursively traversed and merged.
This process allows sparse directories to be individually merged at the
necessary depth *without* expanding a full index.
The 't/t1092-sparse-checkout-compatibility.sh' test 'read-tree --merge with
edit/edit conflicts in sparse directories' tests two-way merges with 1)
changes inside sparse directories that do not conflict and 2) changes that
do conflict (with the correct file(s) reported in the error message).
Additionally, add two-way merge cases to 'sparse index is not expanded:
read-tree' to confirm that the index is not expanded regardless of whether
edit/edit conflicts are present in a sparse directory.
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4034/dts/expect')
0 files changed, 0 insertions, 0 deletions