mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
t4202: split testcase for invalid HEAD symref and HEAD hash
Reftable will prohibit invalid hashes at the storage level, but git-symbolic-ref can still create branches ending in ".lock". Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
54a3917115
commit
230356ba70
|
@ -1834,14 +1834,18 @@ test_expect_success 'log --graph --no-walk is forbidden' '
|
||||||
test_must_fail git log --graph --no-walk
|
test_must_fail git log --graph --no-walk
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'log diagnoses bogus HEAD' '
|
test_expect_success 'log diagnoses bogus HEAD hash' '
|
||||||
git init empty &&
|
git init empty &&
|
||||||
|
test_when_finished "rm -rf empty" &&
|
||||||
test_must_fail git -C empty log 2>stderr &&
|
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 &&
|
||||||
echo 1234abcd >empty/.git/refs/heads/main &&
|
echo 1234abcd >empty/.git/refs/heads/main &&
|
||||||
test_must_fail git -C empty log 2>stderr &&
|
test_must_fail git -C empty log 2>stderr &&
|
||||||
test_i18ngrep broken stderr &&
|
test_i18ngrep broken stderr'
|
||||||
echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
|
|
||||||
|
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_must_fail git -C empty log 2>stderr &&
|
||||||
test_i18ngrep broken stderr &&
|
test_i18ngrep broken stderr &&
|
||||||
test_must_fail git -C empty log --default totally-bogus 2>stderr &&
|
test_must_fail git -C empty log --default totally-bogus 2>stderr &&
|
||||||
|
|
Loading…
Reference in a new issue