Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2021-12-09 08:08:34 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-10 00:33:13 +0300
commit580a5d7f75fc7b6c4c369ef429742d9d417acddd (patch)
treedb3789482029387549d85a8976ebb612e181e81d /t/t2501-cwd-empty.sh
parent63bbe8beb78ee8af5a7faeee4be747a82d8e2dc7 (diff)
dir: new flag to remove_dir_recurse() to spare the original_cwd
remove_dir_recurse(), and its non-static wrapper called remove_dir_recursively(), both take flags for modifying its behavior. As with the previous commits, we would generally like to protect the original_cwd, but we want to forced user commands (e.g. 'git rm -rf ...') or other special cases to remove it. Add a flag for this purpose. After reading through every caller of remove_dir_recursively() in the current codebase, there was only one that should be adjusted and that one only in a very unusual circumstance. Add a pair of new testcases to highlight that very specific case involving submodules && --git-dir && --work-tree. Acked-by: Derrick Stolee <stolee@gmail.com> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2501-cwd-empty.sh')
-rwxr-xr-xt/t2501-cwd-empty.sh5
1 files changed, 0 insertions, 5 deletions
diff --git a/t/t2501-cwd-empty.sh b/t/t2501-cwd-empty.sh
index ce2efb9d30..bc92230f2f 100755
--- a/t/t2501-cwd-empty.sh
+++ b/t/t2501-cwd-empty.sh
@@ -291,11 +291,6 @@ test_submodule_removal () {
test_status=
test "$path_status" = dir && test_status=test_must_fail
- # Actually, while path_status=dir && test_status=test_must_fail
- # reflect our desired behavior, current behavior is:
- path_status=missing
- test_status=
-
test_when_finished "git reset --hard HEAD~1" &&
test_when_finished "rm -rf .git/modules/my_submodule" &&