Re: [PATCH 2/2] refs: allow skipping OID verification
"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Han-Wen Nienhuys <hanwen@google.com>
>
> 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.
Show 13 quoted lines
> 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.