Skip to content

Commit eaf0e83

Browse files
hanwengitster
authored andcommitted
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>
1 parent 53af25e commit eaf0e83

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

t/t5312-prune-corruption.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ test_expect_success 'disable reflogs' '
2222
'
2323

2424
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"
2727
}
2828

2929
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' '
113113
# we do not want to count on running pack-refs to
114114
# actually pack it, as it is perfectly reasonable to
115115
# 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' '
117117
rm -f .git/refs/heads/main &&
118118
cat >.git/packed-refs <<-EOF &&
119119
$missing refs/heads/main
@@ -124,13 +124,13 @@ test_expect_success 'create packed-refs file with broken ref' '
124124
test_cmp expect actual
125125
'
126126

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' '
128128
git pack-refs --all --prune &&
129129
git rev-parse refs/heads/main >actual &&
130130
test_cmp expect actual
131131
'
132132

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' '
134134
git update-ref -d refs/heads/other &&
135135
git rev-parse refs/heads/main >actual &&
136136
test_cmp expect actual

0 commit comments

Comments
 (0)