Skip to content

Commit 75ff34b

Browse files
committed
Merge branch 'hn/reftable-tests'
Prepare more test scripts for the introduction of reftable. * hn/reftable-tests: t5312: prepare for reftable t1405: mark test that checks existence as REFFILES t1405: explictly delete reflogs for reftable
2 parents 0ac270c + eaf0e83 commit 75ff34b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

t/t1405-main-ref-store.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ test_expect_success 'delete_refs(FOO, refs/tags/new-tag)' '
4040
test_must_fail git rev-parse refs/tags/new-tag --
4141
'
4242

43+
# In reftable, we keep the reflogs around for deleted refs.
44+
test_expect_success !REFFILES 'delete-reflog(FOO, refs/tags/new-tag)' '
45+
$RUN delete-reflog FOO &&
46+
$RUN delete-reflog refs/tags/new-tag
47+
'
48+
4349
test_expect_success 'rename_refs(main, new-main)' '
4450
git rev-parse main >expected &&
4551
$RUN rename-ref refs/heads/main refs/heads/new-main &&
@@ -105,7 +111,7 @@ test_expect_success 'delete_reflog(HEAD)' '
105111
test_must_fail git reflog exists HEAD
106112
'
107113

108-
test_expect_success 'create-reflog(HEAD)' '
114+
test_expect_success REFFILES 'create-reflog(HEAD)' '
109115
$RUN create-reflog HEAD &&
110116
git reflog exists HEAD
111117
'

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)