summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-04 02:18:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-04 02:18:04 (GMT)
commit5af77d13529a332bef99d22d0d983d5378edf534 (patch)
tree9e531fa4b19e0de9df5fe18c7fd95816360c7a19 /t
parent9d939886dbea58cf779f53f4c7b246a6562e184e (diff)
parentce113604672fed9b429b1c162b1005794fff6a17 (diff)
downloadgit-5af77d13529a332bef99d22d0d983d5378edf534.zip
git-5af77d13529a332bef99d22d0d983d5378edf534.tar.gz
git-5af77d13529a332bef99d22d0d983d5378edf534.tar.bz2
Merge branch 'jk/log-missing-default-HEAD' into maint
"git init empty && git -C empty log" said "bad default revision 'HEAD'", which was found to be a bit confusing to new users. * jk/log-missing-default-HEAD: log: diagnose empty HEAD more clearly
Diffstat (limited to 't')
-rwxr-xr-xt/t4202-log.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 1b2e981..19277dd 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -871,4 +871,18 @@ test_expect_success 'log --graph --no-walk is forbidden' '
test_must_fail git log --graph --no-walk
'
+test_expect_success 'log diagnoses bogus HEAD' '
+ git init empty &&
+ test_must_fail git -C empty log 2>stderr &&
+ test_i18ngrep does.not.have.any.commits stderr &&
+ echo 1234abcd >empty/.git/refs/heads/master &&
+ test_must_fail git -C empty log 2>stderr &&
+ test_i18ngrep broken stderr &&
+ echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
+ test_must_fail git -C empty log 2>stderr &&
+ test_i18ngrep broken stderr &&
+ test_must_fail git -C empty log --default totally-bogus 2>stderr &&
+ test_i18ngrep broken stderr
+'
+
test_done