summaryrefslogtreecommitdiff
path: root/t/t6018-rev-list-glob.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6018-rev-list-glob.sh')
-rwxr-xr-xt/t6018-rev-list-glob.sh30
1 files changed, 12 insertions, 18 deletions
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index d00f7db..db8a783 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -255,36 +255,30 @@ 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 programatically
-# 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)' '
- >expect &&
- git rev-list --stdin <expect >actual &&
- test_cmp expect actual
+test_expect_success 'rev-list should succeed with empty output on empty stdin' '
+ git rev-list --stdin </dev/null >actual &&
+ test_must_be_empty actual
'
-test_expect_failure 'rev-list may want to succeed with empty output on no input (2)' '
- >expect &&
+test_expect_success 'rev-list should succeed with empty output with all refs excluded' '
git rev-list --exclude=* --all >actual &&
- test_cmp expect actual
+ test_must_be_empty actual
'
-test_expect_failure 'rev-list may want to succeed with empty output on no input (3)' '
+test_expect_success 'rev-list should succeed with empty output with empty --all' '
(
test_create_repo empty &&
cd empty &&
- >expect &&
git rev-list --all >actual &&
- test_cmp expect actual
+ test_must_be_empty actual
)
'
+test_expect_success 'rev-list should succeed with empty output with empty glob' '
+ git rev-list --glob=does-not-match-anything >actual &&
+ test_must_be_empty actual
+'
+
test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
compare shortlog "subspace/one subspace/two" --branches=subspace &&