path: root/t
diff options
authorLinus Torvalds <>2017-02-08 05:08:15 (GMT)
committerJunio C Hamano <>2017-02-10 21:19:40 (GMT)
commit859b7f1d0e742493d2a9396794cd9040213ad846 (patch)
tree8dd558e38011f8192a12ab5e371a5656062130c7 /t
parent42ebeb9d07de3c6d3a263f8ebce0508e489e5cc9 (diff)
pathspec: don't error out on all-exclusionary pathspec patterns
Instead of erroring out and telling the user that they should add a positive pattern that covers everything else, just _do_ that. For commands where we honor the current cwd by default (ie grep, ls-files etc), we make that default positive pathspec be the current working directory. And for commands that default to the whole project (ie diff, log, etc), the default positive pathspec is the whole project. Signed-off-by: Linus Torvalds <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't')
1 files changed, 4 insertions, 2 deletions
diff --git a/t/ b/t/
index d51595c..9dd5cde 100755
--- a/t/
+++ b/t/
@@ -25,8 +25,10 @@ EOF
test_cmp expect actual
-test_expect_success 'exclude only should error out' '
- test_must_fail git log --oneline --format=%s -- ":(exclude)sub"
+test_expect_success 'exclude only no longer errors out' '
+ git log --oneline --format=%s -- . ":(exclude)sub" >expect &&
+ git log --oneline --format=%s -- ":(exclude)sub" >actual &&
+ test_cmp expect actual
test_expect_success 't_e_i() exclude sub' '