tests: Add more tests cases for ignoring .git

This commit is contained in:
Thayne McCombs 2023-10-22 23:03:31 -06:00 committed by David Peter
parent 08910e4e3f
commit 306dacd0b4
1 changed files with 14 additions and 4 deletions

View File

@ -2561,8 +2561,14 @@ fn test_invalid_cwd() {
#[test]
fn test_git_dir() {
let te = TestEnv::new(
&[".git/one"],
&[".git/one/foo.a", ".git/.foo", ".git/a.foo"],
&[".git/one", "other_dir/.git", "nested/dir/.git"],
&[
".git/one/foo.a",
".git/.foo",
".git/a.foo",
"other_dir/.git/foo1",
"nested/dir/.git/foo2",
],
);
te.assert_output(&["--hidden", "foo"], "");
@ -2571,12 +2577,16 @@ fn test_git_dir() {
&["--hidden", "--no-ignore", "foo"],
".git/one/foo.a
.git/.foo
.git/a.foo",
.git/a.foo
other_dir/.git/foo1
nested/dir/.git/foo2",
);
te.assert_output(
&["--hidden", "--no-ignore-vcs", "foo"],
".git/one/foo.a
.git/.foo
.git/a.foo",
.git/a.foo
other_dir/.git/foo1
nested/dir/.git/foo2",
);
}