On Tue, May 2, 2017 at 8:29 PM, Samuel Lijin <sxlijin@xxxxxxxxx> wrote: > If git sees a directory which contains only untracked and ignored > files, clean -d should not remove that directory. Yes that states a fact; it is not clear why we want to have this test here and now. (Is it testing for a recently fixed regression?) Are you just introducing the test to demonstrate it keeps working later on? Do you plan on changing this behavior in a later patch?) > --- > t/t7300-clean.sh | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh > index b89fd2a6a..948a455e8 100755 > --- a/t/t7300-clean.sh > +++ b/t/t7300-clean.sh > @@ -653,4 +653,14 @@ test_expect_success 'git clean -d respects pathspecs (pathspec is prefix of dir) > test_path_is_dir foobar > ' > > +test_expect_success 'git clean -d skips untracked dirs containing ignored files' ' > + echo /foo/bar >.gitignore && > + rm -rf foo && > + mkdir -p foo && > + touch foo/bar && > + git clean -df && > + test_path_is_file foo/bar && > + test_path_is_dir foo > +' The test makes sense, though I am wondering if we can integrate this test into another test e.g. "ok 15 - git clean -d". Is the -f flag needed? Thanks, Stefan