summaryrefslogtreecommitdiff
path: root/t/t4202-log.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t4202-log.sh')
-rwxr-xr-xt/t4202-log.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 1b2e981a00..658c440689 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -871,4 +871,15 @@ 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 "you do not have a commit yet" stderr &&
+ git rev-parse HEAD >empty/.git/refs/heads/master &&
+ test_must_fail git -C empty log 2>stderr &&
+ test_i18ngrep "bad object HEAD" stderr &&
+ test_must_fail git -C empty log --default totally-bogus 2>stderr &&
+ test_i18ngrep bad.default.revision stderr
+'
+
test_done