diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-07-13 16:52:50 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-07-13 16:52:50 -0700 |
commit | c9780bb2ca81828ec4f43c60b2107c335271a72f (patch) | |
tree | c996adbe0e76851f0e71fbd8668a163a2f683378 /t/t4202-log.sh | |
parent | Merge branch 'fc/push-simple-updates-cleanup' (diff) | |
parent | t1415: set REFFILES for test specific to storage format (diff) | |
download | tgif-c9780bb2ca81828ec4f43c60b2107c335271a72f.tar.xz |
Merge branch 'hn/prep-tests-for-reftable'
Preliminary clean-up of tests before the main reftable changes
hits the codebase.
* hn/prep-tests-for-reftable: (22 commits)
t1415: set REFFILES for test specific to storage format
t4202: mark bogus head hash test with REFFILES
t7003: check reflog existence only for REFFILES
t7900: stop checking for loose refs
t1404: mark tests that muck with .git directly as REFFILES.
t2017: mark --orphan/logAllRefUpdates=false test as REFFILES
t1414: mark corruption test with REFFILES
t1407: require REFFILES for for_each_reflog test
test-lib: provide test prereq REFFILES
t5304: use "reflog expire --all" to clear the reflog
t5304: restyle: trim empty lines, drop ':' before >
t7003: use rev-parse rather than FS inspection
t5000: inspect HEAD using git-rev-parse
t5000: reformat indentation to the latest fashion
t1301: fix typo in error message
t1413: use tar to save and restore entire .git directory
t1401-symbolic-ref: avoid direct filesystem access
t1401: use tar to snapshot and restore repo state
t5601: read HEAD using rev-parse
t9300: check ref existence using test-helper rather than a file system check
...
Diffstat (limited to 't/t4202-log.sh')
-rwxr-xr-x | t/t4202-log.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 350cfa3593..39e746fbcb 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 && |