diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-02-16 17:57:06 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-16 17:57:06 -0800 |
commit | 987e315a6b5a5dd224602f09b9dc7c0fe9c7d024 (patch) | |
tree | ce10af22609413c4316e12335387bcfa0ef1bf9b /t | |
parent | 1ae419cb3902e6cc45538a9673539ed5316fcf30 (diff) | |
parent | 6831a88ac03759a8133f10ffd52ad235a081a8a3 (diff) | |
download | git-987e315a6b5a5dd224602f09b9dc7c0fe9c7d024.tar.gz git-987e315a6b5a5dd224602f09b9dc7c0fe9c7d024.tar.xz |
Merge branch 'jc/gitignore-ends-with-slash'
* jc/gitignore-ends-with-slash:
gitignore: lazily find dtype
gitignore(5): Allow "foo/" in ignore list to match directory "foo"
Diffstat (limited to 't')
-rwxr-xr-x | t/t3001-ls-files-others-exclude.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh index e25b25568..b4297bacf 100755 --- a/t/t3001-ls-files-others-exclude.sh +++ b/t/t3001-ls-files-others-exclude.sh @@ -99,4 +99,45 @@ EOF test_expect_success 'git-status honours core.excludesfile' \ 'diff -u expect output' +test_expect_success 'trailing slash in exclude allows directory match(1)' ' + + git ls-files --others --exclude=one/ >output && + if grep "^one/" output + then + echo Ooops + false + else + : happy + fi + +' + +test_expect_success 'trailing slash in exclude allows directory match (2)' ' + + git ls-files --others --exclude=one/two/ >output && + if grep "^one/two/" output + then + echo Ooops + false + else + : happy + fi + +' + +test_expect_success 'trailing slash in exclude forces directory match (1)' ' + + >two + git ls-files --others --exclude=two/ >output && + grep "^two" output + +' + +test_expect_success 'trailing slash in exclude forces directory match (2)' ' + + git ls-files --others --exclude=one/a.1/ >output && + grep "^one/a.1" output + +' + test_done |