aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-11 13:27:07 -0700
committerJunio C Hamano <gitster@pobox.com>2017-08-11 13:27:07 -0700
commit8fbaf0b13bc54819445f613e917c44ea52eef804 (patch)
tree9f02a6c5723b33fd6249d36a9573079560601e69 /t
parent9c1259a0da0cb37f4bf8926b162ccb73203589e1 (diff)
parent5d34d1ac06fe70fc0a7a8f35ddf9e7690114dda7 (diff)
downloadgit-8fbaf0b13bc54819445f613e917c44ea52eef804.tar.gz
git-8fbaf0b13bc54819445f613e917c44ea52eef804.tar.xz
Merge branch 'jk/rev-list-empty-input'
"git log --tag=no-such-tag" showed log starting from HEAD, which has been fixed---it now shows nothing. * jk/rev-list-empty-input: revision: do not fallback to default when rev_input_given is set rev-list: don't show usage when we see empty ref patterns revision: add rev_input_given flag t6018: flesh out empty input/output rev-list tests
Diffstat (limited to 't')
-rwxr-xr-xt/t4202-log.sh6
-rwxr-xr-xt/t6018-rev-list-glob.sh20
2 files changed, 15 insertions, 11 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 3f3531f0a..36d120c96 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -1523,6 +1523,12 @@ test_expect_success 'log diagnoses bogus HEAD' '
test_i18ngrep broken stderr
'
+test_expect_success 'log does not default to HEAD when rev input is given' '
+ >expect &&
+ git log --branches=does-not-exist >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'set up --source tests' '
git checkout --orphan source-a &&
test_commit one &&
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index 381f35ed1..d3453c583 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_success '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_success '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_success '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 &&