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>
This commit is contained in:
parent
53af25e47c
commit
eaf0e83009
@ -22,8 +22,8 @@ test_expect_success 'disable reflogs' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
create_bogus_ref () {
|
create_bogus_ref () {
|
||||||
test_when_finished 'rm -f .git/refs/heads/bogus..name' &&
|
test-tool ref-store main update-ref msg "refs/heads/bogus..name" $bogus $ZERO_OID REF_SKIP_REFNAME_VERIFICATION &&
|
||||||
echo $bogus >.git/refs/heads/bogus..name
|
test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/bogus..name"
|
||||||
}
|
}
|
||||||
|
|
||||||
test_expect_success 'create history reachable only from a bogus-named ref' '
|
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' '
|
|||||||
# we do not want to count on running pack-refs to
|
# we do not want to count on running pack-refs to
|
||||||
# actually pack it, as it is perfectly reasonable to
|
# actually pack it, as it is perfectly reasonable to
|
||||||
# skip processing a broken ref
|
# skip processing a broken ref
|
||||||
test_expect_success 'create packed-refs file with broken ref' '
|
test_expect_success REFFILES 'create packed-refs file with broken ref' '
|
||||||
rm -f .git/refs/heads/main &&
|
rm -f .git/refs/heads/main &&
|
||||||
cat >.git/packed-refs <<-EOF &&
|
cat >.git/packed-refs <<-EOF &&
|
||||||
$missing refs/heads/main
|
$missing refs/heads/main
|
||||||
@ -124,13 +124,13 @@ test_expect_success 'create packed-refs file with broken ref' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'pack-refs does not silently delete broken packed ref' '
|
test_expect_success REFFILES 'pack-refs does not silently delete broken packed ref' '
|
||||||
git pack-refs --all --prune &&
|
git pack-refs --all --prune &&
|
||||||
git rev-parse refs/heads/main >actual &&
|
git rev-parse refs/heads/main >actual &&
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'pack-refs does not drop broken refs during deletion' '
|
test_expect_success REFFILES 'pack-refs does not drop broken refs during deletion' '
|
||||||
git update-ref -d refs/heads/other &&
|
git update-ref -d refs/heads/other &&
|
||||||
git rev-parse refs/heads/main >actual &&
|
git rev-parse refs/heads/main >actual &&
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
|
Loading…
Reference in New Issue
Block a user