diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-09-02 12:50:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-02 12:50:10 -0700 |
commit | 699a0f3748474fce7b688212c3f9ab25d7b750f5 (patch) | |
tree | 9b913deb5ef0e5855400f5c7e43f9d8f721aa90c /t | |
parent | Ninth batch for 2.6 (diff) | |
parent | log: diagnose empty HEAD more clearly (diff) | |
download | tgif-699a0f3748474fce7b688212c3f9ab25d7b750f5.tar.xz |
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')
-rwxr-xr-x | t/t4202-log.sh | 14 |
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 |