aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-09-30 13:19:31 +0900
committerJunio C Hamano <gitster@pobox.com>2019-09-30 13:19:31 +0900
commit026428c35eb7e4018de3707a08a7dc3d23a69712 (patch)
tree997cf4cc9627b4f7a28f71ee71d31aaf60d764fa
parentMerge branch 'dl/complete-cherry-pick-revert-skip' (diff)
parentt7300-clean: demonstrate deleting nested repo with an ignored file breakage (diff)
downloadgit-026428c35eb7e4018de3707a08a7dc3d23a69712.tar.gz
git-026428c35eb7e4018de3707a08a7dc3d23a69712.zip
Merge branch 'sg/clean-nested-repo-with-ignored'
A bug documentation. * sg/clean-nested-repo-with-ignored: t7300-clean: demonstrate deleting nested repo with an ignored file breakage
-rwxr-xr-xt/t7300-clean.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index a2c45d1902..d01fd120ab 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -669,6 +669,28 @@ test_expect_success 'git clean -d skips untracked dirs containing ignored files'
test_path_is_missing foo/b/bb
'
+test_expect_failure 'git clean -d skips nested repo containing ignored files' '
+ test_when_finished "rm -rf nested-repo-with-ignored-file" &&
+
+ git init nested-repo-with-ignored-file &&
+ (
+ cd nested-repo-with-ignored-file &&
+ >file &&
+ git add file &&
+ git commit -m Initial &&
+
+ # This file is ignored by a .gitignore rule in the outer repo
+ # added in the previous test.
+ >ignoreme
+ ) &&
+
+ git clean -fd &&
+
+ test_path_is_file nested-repo-with-ignored-file/.git/index &&
+ test_path_is_file nested-repo-with-ignored-file/ignoreme &&
+ test_path_is_file nested-repo-with-ignored-file/file
+'
+
test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
test_config core.longpaths false &&
a50=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&