t5312: prepare for reftable

Mark some tests as REFFILES if they rely on packed refs. Use ref-store helper to create bogus refs. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Han-Wen Nienhuys committed Jan 31, 2022 at 17:50 UTC eaf0e83009f37263849be5d4bf6c394b73546bd3
1 file changed +5 -5
t/t5312-prune-corruption.sh
+5 -5
@@ -22,8 +22,8 @@ test_expect_success 'disable reflogs' '
22 '
23
24 create_bogus_ref () {
25 - test_when_finished 'rm -f .git/refs/heads/bogus..name' &&
26 - echo $bogus >.git/refs/heads/bogus..name
25 + test-tool ref-store main update-ref msg "refs/heads/bogus..name" $bogus $ZERO_OID REF_SKIP_REFNAME_VERIFICATION &&
26 + test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/bogus..name"
27 }
28
29 test_expect_success 'create history reachable only from a bogus-named ref' '
@@ -113,7 +113,7 @@ test_expect_success 'pack-refs does not silently delete broken loose ref' '
113 # we do not want to count on running pack-refs to
114 # actually pack it, as it is perfectly reasonable to
115 # skip processing a broken ref
116 -test_expect_success 'create packed-refs file with broken ref' '
116 +test_expect_success REFFILES 'create packed-refs file with broken ref' '
117 rm -f .git/refs/heads/main &&
118 cat >.git/packed-refs <<-EOF &&
119 $missing refs/heads/main
@@ -124,13 +124,13 @@ test_expect_success 'create packed-refs file with broken ref' '
124 test_cmp expect actual
125 '
126
127 -test_expect_success 'pack-refs does not silently delete broken packed ref' '
127 +test_expect_success REFFILES 'pack-refs does not silently delete broken packed ref' '
128 git pack-refs --all --prune &&
129 git rev-parse refs/heads/main >actual &&
130 test_cmp expect actual
131 '
132
133 -test_expect_success 'pack-refs does not drop broken refs during deletion' '
133 +test_expect_success REFFILES 'pack-refs does not drop broken refs during deletion' '
134 git update-ref -d refs/heads/other &&
135 git rev-parse refs/heads/main >actual &&
136 test_cmp expect actual