Files
git/builtin
Derrick Stolee d7c4415e55 rm: skip sparse paths with missing SKIP_WORKTREE
If a path does not match the sparse-checkout cone but is somehow missing
the SKIP_WORKTREE bit, then 'git rm' currently succeeds in removing the
file. One reason a user might be in this situation is a merge conflict
outside of the sparse-checkout cone. Removing such a file might be
problematic for users who are not sure what they are doing.

Add a check to path_in_sparse_checkout() when 'git rm' is checking if a
path should be considered for deletion. Of course, this check is ignored
if the '--sparse' option is specified, allowing users who accept the
risks to continue with the removal.

This also removes a confusing behavior where a user asks for a directory
to be removed, but only the entries that are within the sparse-checkout
definition are removed. Now, 'git rm <dir>' will fail without '--sparse'
and will succeed in removing all contained paths with '--sparse'.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-28 10:31:02 -07:00
..
2021-02-25 16:43:29 -08:00
2021-04-20 11:09:50 -07:00
2021-06-04 07:50:26 +09:00
2021-01-06 15:10:49 -08:00
2020-10-16 12:30:45 -07:00
2021-02-25 16:43:30 -08:00
2021-02-25 16:43:30 -08:00
2021-07-28 13:17:59 -07:00
2021-05-07 12:47:41 +09:00
2021-06-02 07:34:27 +09:00
2021-05-12 07:00:45 +09:00
2021-07-28 13:17:58 -07:00
2021-04-07 16:54:08 -07:00
2021-04-14 13:47:21 -07:00
2021-09-09 15:49:04 -07:00
2021-03-13 16:00:09 -08:00
2021-06-19 16:36:17 +09:00
2021-06-02 10:12:03 +09:00
2021-04-07 16:54:08 -07:00
2021-01-25 14:19:19 -08:00
2021-07-16 17:42:53 -07:00
2021-04-20 11:09:50 -07:00
2021-04-14 13:47:29 -07:00