]> git.ipfire.org Git - thirdparty/git.git/commit
rm: honor sparse checkout patterns
authorMatheus Tavares <matheus.bernardino@usp.br>
Thu, 8 Apr 2021 20:41:28 +0000 (17:41 -0300)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Apr 2021 21:18:03 +0000 (14:18 -0700)
commitd5f4b8260f623d6fdef36d5eaa8a0c2350390472
tree60de9c3ff1ee4936bbb0e8eb231731ea52de4c29
parenta20f70478ffcc66d30936920ebcc35ebfc12a7c7
rm: honor sparse checkout patterns

`git add` refrains from adding or updating index entries that are
outside the current sparse checkout, but `git rm` doesn't follow the
same restriction. This is somewhat counter-intuitive and inconsistent.
So make `rm` honor the sparsity rules and advise on how to remove
SKIP_WORKTREE entries just like `add` does. Also add some tests for the
new behavior.

Suggested-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/advice.txt
Documentation/git-rm.txt
builtin/rm.c
t/t3602-rm-sparse-checkout.sh [new file with mode: 0755]
t/t7011-skip-worktree-reading.sh