From: Junio C Hamano Date: Fri, 26 Nov 2021 07:32:03 GMT Subject: Re: [PATCH 2/2] refs: allow skipping OID verification Message-ID: In-Reply-To: <900cea2ade9e86b135e4189070a68deea5e9b575.1637855761.git.gitgitgadget@gmail.com> "Han-Wen Nienhuys via GitGitGadget" writes: > From: Han-Wen Nienhuys > > This introduces the REF_SKIP_OID_VERIFICATION flag, which lets the ref-store > test helper write non-existent or unparsable objects into the ref storage. Yay. > diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh > index 658628375c8..f5333196b07 100755 > --- a/t/t1006-cat-file.sh > +++ b/t/t1006-cat-file.sh > @@ -452,9 +452,8 @@ test_expect_success 'the --allow-unknown-type option does not consider replaceme > # Create it manually, as "git replace" will die on bogus > # types. > head=$(git rev-parse --verify HEAD) && > - test_when_finished "rm -rf .git/refs/replace" && > - mkdir -p .git/refs/replace && > - echo $head >.git/refs/replace/$bogus_short_sha1 && > + test_when_finished "test-tool ref-store main delete-refs 0 msg refs/replace/$bogus_short_sha1" && > + test-tool ref-store main update-ref msg "refs/replace/$bogus_short_sha1" $head $ZERO_OID 1024 && Double yay. Tests that are independent of backend is indeed much nicer.