diff options
Diffstat (limited to 't/t4202-log.sh')
-rwxr-xr-x | t/t4202-log.sh | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 350cfa3593..9dfead936b 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -1834,14 +1834,24 @@ test_expect_success 'log --graph --no-walk is forbidden' ' test_must_fail git log --graph --no-walk ' -test_expect_success 'log diagnoses bogus HEAD' ' +test_expect_success 'log on empty repo fails' ' git init empty && + test_when_finished "rm -rf empty" && test_must_fail git -C empty log 2>stderr && - test_i18ngrep does.not.have.any.commits stderr && + test_i18ngrep does.not.have.any.commits stderr +' + +test_expect_success REFFILES 'log diagnoses bogus HEAD hash' ' + git init empty && + test_when_finished "rm -rf empty" && echo 1234abcd >empty/.git/refs/heads/main && test_must_fail git -C empty log 2>stderr && - test_i18ngrep broken stderr && - echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD && + test_i18ngrep broken stderr +' + +test_expect_success 'log diagnoses bogus HEAD symref' ' + git init empty && + git --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock && 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 && @@ -1905,6 +1915,20 @@ test_expect_success '--exclude-promisor-objects does not BUG-crash' ' test_must_fail git log --exclude-promisor-objects source-a ' +test_expect_success 'log --decorate includes all levels of tag annotated tags' ' + git checkout -b branch && + git commit --allow-empty -m "new commit" && + git tag lightweight HEAD && + git tag -m annotated annotated HEAD && + git tag -m double-0 double-0 HEAD && + git tag -m double-1 double-1 double-0 && + cat >expect <<-\EOF && + HEAD -> branch, tag: lightweight, tag: double-1, tag: double-0, tag: annotated + EOF + git log -1 --format="%D" >actual && + test_cmp expect actual +' + test_expect_success 'log --end-of-options' ' git update-ref refs/heads/--source HEAD && git log --end-of-options --source >actual && |