diff options
author | Karsten Blees <karsten.blees@gmail.com> | 2013-04-15 21:08:42 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-15 12:33:59 -0700 |
commit | c94ab010266776c85b588473260ed048d1e654ff (patch) | |
tree | bd0d87822819fee6670fe77394b1fa26ef18a144 /t/t7061-wtstatus-ignore.sh | |
parent | 184d2a8e964d721c20775026308fcf63d57c0b4d (diff) | |
download | git-c94ab010266776c85b588473260ed048d1e654ff.tar.gz |
dir.c: git-status --ignored: don't list empty directories as ignored
'git-status --ignored' lists empty untracked directories as ignored, even
though they don't have any ignored files.
When checking if a directory is already listed as untracked (i.e. shouldn't
be listed as ignored as well), don't assume that the directory has only
ignored files if it doesn't have untracked files, as the directory may be
empty.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7061-wtstatus-ignore.sh')
-rwxr-xr-x | t/t7061-wtstatus-ignore.sh | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/t/t7061-wtstatus-ignore.sh b/t/t7061-wtstatus-ignore.sh index 28b7d957a5..6171a49cf9 100755 --- a/t/t7061-wtstatus-ignore.sh +++ b/t/t7061-wtstatus-ignore.sh @@ -64,13 +64,35 @@ cat >expected <<\EOF ?? .gitignore ?? actual ?? expected -!! untracked-ignored/ EOF -test_expect_success 'status untracked directory with ignored files with --ignore' ' +test_expect_success 'status empty untracked directory with --ignore' ' rm -rf ignored && mkdir untracked-ignored && mkdir untracked-ignored/test && + git status --porcelain --ignored >actual && + test_cmp expected actual +' + +cat >expected <<\EOF +?? .gitignore +?? actual +?? expected +EOF + +test_expect_success 'status empty untracked directory with --ignore -u' ' + git status --porcelain --ignored -u >actual && + test_cmp expected actual +' + +cat >expected <<\EOF +?? .gitignore +?? actual +?? expected +!! untracked-ignored/ +EOF + +test_expect_success 'status untracked directory with ignored files with --ignore' ' : >untracked-ignored/ignored && : >untracked-ignored/test/ignored && git status --porcelain --ignored >actual && |