Skip to content

Commit 026428c

Browse files
committed
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
2 parents 21db12c + 502c386 commit 026428c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

t/t7300-clean.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,28 @@ test_expect_success 'git clean -d skips untracked dirs containing ignored files'
669669
test_path_is_missing foo/b/bb
670670
'
671671

672+
test_expect_failure 'git clean -d skips nested repo containing ignored files' '
673+
test_when_finished "rm -rf nested-repo-with-ignored-file" &&
674+
675+
git init nested-repo-with-ignored-file &&
676+
(
677+
cd nested-repo-with-ignored-file &&
678+
>file &&
679+
git add file &&
680+
git commit -m Initial &&
681+
682+
# This file is ignored by a .gitignore rule in the outer repo
683+
# added in the previous test.
684+
>ignoreme
685+
) &&
686+
687+
git clean -fd &&
688+
689+
test_path_is_file nested-repo-with-ignored-file/.git/index &&
690+
test_path_is_file nested-repo-with-ignored-file/ignoreme &&
691+
test_path_is_file nested-repo-with-ignored-file/file
692+
'
693+
672694
test_expect_success MINGW 'handle clean & core.longpaths = false nicely' '
673695
test_config core.longpaths false &&
674696
a50=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&

0 commit comments

Comments
 (0)