summaryrefslogtreecommitdiff
path: root/t/t6018-rev-list-glob.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-08-02 22:24:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-02 22:45:19 (GMT)
commit0c5dc7431a01d325e815ce722d80ad549a41e632 (patch)
tree50e8e31765fa62aa25c5f34837971f8f961330f7 /t/t6018-rev-list-glob.sh
parent384a8b271c076693d00c97184b5c41ab3a95e64d (diff)
downloadgit-0c5dc7431a01d325e815ce722d80ad549a41e632.zip
git-0c5dc7431a01d325e815ce722d80ad549a41e632.tar.gz
git-0c5dc7431a01d325e815ce722d80ad549a41e632.tar.bz2
t6018: flesh out empty input/output rev-list tests
In 751a2ac6e (rev-list --exclude: tests, 2013-11-01), we added a few tests for handling "empty" inputs with rev-list (i.e., where the user gave us some pattern but it turned out not to queue any objects for traversal), all of which were marked as failing. In preparation for working on this area of the code, let's give each test a more descriptive name. Let's also include one more case which we should cover: feeding a --glob pattern that doesn't match anything. We can also drop the explanatory comment; we'll be converting these to expect_success in the next few patches, so the discussion isn't necessary. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6018-rev-list-glob.sh')
-rwxr-xr-xt/t6018-rev-list-glob.sh20
1 files changed, 9 insertions, 11 deletions
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index 381f35e..f8367b8 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -255,27 +255,19 @@ test_expect_success 'rev-list accumulates multiple --exclude' '
compare rev-list "--exclude=refs/remotes/* --exclude=refs/tags/* --all" --branches
'
-
-# "git rev-list<ENTER>" is likely to be a bug in the calling script and may
-# deserve an error message, but do cases where set of refs programmatically
-# given using globbing and/or --stdin need to fail with the same error, or
-# are we better off reporting a success with no output? The following few
-# tests document the current behaviour to remind us that we might want to
-# think about this issue.
-
-test_expect_failure 'rev-list may want to succeed with empty output on no input (1)' '
+test_expect_failure 'rev-list should succeed with empty output on empty stdin' '
>expect &&
git rev-list --stdin <expect >actual &&
test_cmp expect actual
'
-test_expect_failure 'rev-list may want to succeed with empty output on no input (2)' '
+test_expect_failure 'rev-list should succeed with empty output with all refs excluded' '
>expect &&
git rev-list --exclude=* --all >actual &&
test_cmp expect actual
'
-test_expect_failure 'rev-list may want to succeed with empty output on no input (3)' '
+test_expect_failure 'rev-list should succeed with empty output with empty --all' '
(
test_create_repo empty &&
cd empty &&
@@ -285,6 +277,12 @@ test_expect_failure 'rev-list may want to succeed with empty output on no input
)
'
+test_expect_failure 'rev-list should succeed with empty output with empty glob' '
+ >expect &&
+ git rev-list --glob=does-not-match-anything >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
compare shortlog "subspace/one subspace/two" --branches=subspace &&