diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2021-09-24 15:39:11 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-28 10:31:02 -0700 |
commit | f9786f9b85a6930a711e0ca8ba317c619f02bd8b (patch) | |
tree | f9ba93140dab018ca906e371ae93a0b110644229 /t | |
parent | add: update --renormalize to skip sparse paths (diff) | |
download | tgif-f9786f9b85a6930a711e0ca8ba317c619f02bd8b.tar.xz |
rm: add --sparse option
As we did previously in 'git add', add a '--sparse' option to 'git rm'
that allows modifying paths outside of the sparse-checkout definition.
The existing checks in 'git rm' are restricted to tracked files that
have the SKIP_WORKTREE bit in the current index. Future changes will
cause 'git rm' to reject removing paths outside of the sparse-checkout
definition, even if they are untracked or do not have the SKIP_WORKTREE
bit.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t3602-rm-sparse-checkout.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t3602-rm-sparse-checkout.sh b/t/t3602-rm-sparse-checkout.sh index e9e9a15c74..493c8f636b 100755 --- a/t/t3602-rm-sparse-checkout.sh +++ b/t/t3602-rm-sparse-checkout.sh @@ -43,6 +43,18 @@ test_expect_success 'recursive rm does not remove sparse entries' ' test_cmp expected actual ' +test_expect_success 'recursive rm --sparse removes sparse entries' ' + git reset --hard && + git sparse-checkout set "sub/dir" && + git rm --sparse -r sub && + git status --porcelain -uno >actual && + cat >expected <<-\EOF && + D sub/d + D sub/dir/e + EOF + test_cmp expected actual +' + test_expect_success 'rm obeys advice.updateSparsePath' ' git reset --hard && git sparse-checkout set a && |