summaryrefslogtreecommitdiff
path: root/t/t4202-log.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-02 12:50:08 -0700
committerJunio C Hamano <gitster@pobox.com>2015-09-02 12:50:10 -0700
commit699a0f3748474fce7b688212c3f9ab25d7b750f5 (patch)
tree9b913deb5ef0e5855400f5c7e43f9d8f721aa90c /t/t4202-log.sh
parent7aa67f62c7cc0f5771dffe58c3234b6940d35a5d (diff)
parentce113604672fed9b429b1c162b1005794fff6a17 (diff)
downloadgit-699a0f3748474fce7b688212c3f9ab25d7b750f5.tar.gz
Merge branch 'jk/log-missing-default-HEAD'
"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/t4202-log.sh')
-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 35d2d7c221..6ede0692f6 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -894,4 +894,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