summaryrefslogtreecommitdiff
path: root/merge-ort-wrappers.c
diff options
context:
space:
mode:
authorLibravatar Derrick Stolee <dstolee@microsoft.com>2021-09-24 15:39:06 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-09-28 10:31:02 -0700
commit105e8b014b1d584174aca81081ee5428caea03cb (patch)
treec9add6c3e84ab87373922fb3a8d6f089313d5941 /merge-ort-wrappers.c
parentdir: fix pattern matching on dirs (diff)
downloadtgif-105e8b014b1d584174aca81081ee5428caea03cb.tar.xz
add: fail when adding an untracked sparse file
The add_files() method in builtin/add.c takes a set of untracked files that are being added by the input pathspec and inserts them into the index. If these files are outside of the sparse-checkout cone, then they gain the SKIP_WORKTREE bit at some point. However, this was not checked before inserting into the index, so these files are added even though we want to avoid modifying the index outside of the sparse-checkout cone. Add a check within add_files() for these files and write the advice about files outside of the sparse-checkout cone. This behavior change modifies some existing tests within t1092. These tests intended to document how a user could interact with the existing behavior in place. Many of these tests need to be marked as expecting failure. A future change will allow these tests to pass by adding a flag to 'git add' that allows users to modify index entries outside of the sparse-checkout cone. The 'submodule handling' test is intended to document what happens to directories that contain a submodule when the sparse index is enabled. It is not trying to say that users should be able to add submodules outside of the sparse-checkout cone, so that test can be modified to avoid that operation. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-ort-wrappers.c')
0 files changed, 0 insertions, 0 deletions