summaryrefslogtreecommitdiff
path: root/t/t4202-log.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2017-08-02 18:30:19 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-08-02 15:45:22 -0700
commit5d34d1ac06fe70fc0a7a8f35ddf9e7690114dda7 (patch)
treecaa5584f37f25395ae4121fe660cc3e9a290db56 /t/t4202-log.sh
parentrev-list: don't show usage when we see empty ref patterns (diff)
downloadtgif-5d34d1ac06fe70fc0a7a8f35ddf9e7690114dda7.tar.xz
revision: do not fallback to default when rev_input_given is set
If revs->def is set (as it is in "git log") and there are no pending objects after parsing the user's input, then we show whatever is in "def". But if the user _did_ ask for some input that just happened to be empty (e.g., "--glob" that does not match anything), showing the default revision is confusing. We should just show nothing, as that is what the user's request yielded. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4202-log.sh')
-rwxr-xr-xt/t4202-log.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 3f3531f0a4..36d120c969 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 &&