t1404: mark tests that muck with .git directly as REFFILES.
The packed/loose ref storage is an overlay combination of packed-refs (refs and tags in a single file) and one-file-per-ref. This creates all kinds of edge cases related to directory/file conflicts, (non-)empty directories, and the locking scheme, none of which applies to reftable. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Han-Wen Nienhuys committed
May 31, 2021 at 16:56 UTC
fe8fc09f34c353b744d793d45c2ee62fb1a5f699
1 file changed
+15
-15
t/t1404-update-ref-errors.sh
+15
-15
@@ -189,7 +189,7 @@ test_expect_success 'one new ref is a simple prefix of another' '
189
190
'
191
192
-test_expect_success 'empty directory should not fool rev-parse' '
192
+test_expect_success REFFILES 'empty directory should not fool rev-parse' '
193
prefix=refs/e-rev-parse &&
194
git update-ref $prefix/foo $C &&
195
git pack-refs --all &&
@@ -199,7 +199,7 @@ test_expect_success 'empty directory should not fool rev-parse' '
199
test_cmp expected actual
200
'
201
202
-test_expect_success 'empty directory should not fool for-each-ref' '
202
+test_expect_success REFFILES 'empty directory should not fool for-each-ref' '
203
prefix=refs/e-for-each-ref &&
204
git update-ref $prefix/foo $C &&
205
git for-each-ref $prefix >expected &&
@@ -209,14 +209,14 @@ test_expect_success 'empty directory should not fool for-each-ref' '
209
test_cmp expected actual
210
'
211
212
-test_expect_success 'empty directory should not fool create' '
212
+test_expect_success REFFILES 'empty directory should not fool create' '
213
prefix=refs/e-create &&
214
mkdir -p .git/$prefix/foo/bar/baz &&
215
printf "create %s $C\n" $prefix/foo |
216
git update-ref --stdin
217
'
218
219
-test_expect_success 'empty directory should not fool verify' '
219
+test_expect_success REFFILES 'empty directory should not fool verify' '
220
prefix=refs/e-verify &&
221
git update-ref $prefix/foo $C &&
222
git pack-refs --all &&
@@ -225,7 +225,7 @@ test_expect_success 'empty directory should not fool verify' '
225
git update-ref --stdin
226
'
227
228
-test_expect_success 'empty directory should not fool 1-arg update' '
228
+test_expect_success REFFILES 'empty directory should not fool 1-arg update' '
229
prefix=refs/e-update-1 &&
230
git update-ref $prefix/foo $C &&
231
git pack-refs --all &&
@@ -234,7 +234,7 @@ test_expect_success 'empty directory should not fool 1-arg update' '
234
git update-ref --stdin
235
'
236
237
-test_expect_success 'empty directory should not fool 2-arg update' '
237
+test_expect_success REFFILES 'empty directory should not fool 2-arg update' '
238
prefix=refs/e-update-2 &&
239
git update-ref $prefix/foo $C &&
240
git pack-refs --all &&
@@ -243,7 +243,7 @@ test_expect_success 'empty directory should not fool 2-arg update' '
243
git update-ref --stdin
244
'
245
246
-test_expect_success 'empty directory should not fool 0-arg delete' '
246
+test_expect_success REFFILES 'empty directory should not fool 0-arg delete' '
247
prefix=refs/e-delete-0 &&
248
git update-ref $prefix/foo $C &&
249
git pack-refs --all &&
@@ -252,7 +252,7 @@ test_expect_success 'empty directory should not fool 0-arg delete' '
252
git update-ref --stdin
253
'
254
255
-test_expect_success 'empty directory should not fool 1-arg delete' '
255
+test_expect_success REFFILES 'empty directory should not fool 1-arg delete' '
256
prefix=refs/e-delete-1 &&
257
git update-ref $prefix/foo $C &&
258
git pack-refs --all &&
@@ -466,7 +466,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '
466
test_cmp expected output.err
467
'
468
469
-test_expect_success 'non-empty directory blocks create' '
469
+test_expect_success REFFILES 'non-empty directory blocks create' '
470
prefix=refs/ne-create &&
471
mkdir -p .git/$prefix/foo/bar &&
472
: >.git/$prefix/foo/bar/baz.lock &&
@@ -485,7 +485,7 @@ test_expect_success 'non-empty directory blocks create' '
485
test_cmp expected output.err
486
'
487
488
-test_expect_success 'broken reference blocks create' '
488
+test_expect_success REFFILES 'broken reference blocks create' '
489
prefix=refs/broken-create &&
490
mkdir -p .git/$prefix &&
491
echo "gobbledigook" >.git/$prefix/foo &&
@@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '
504
test_cmp expected output.err
505
'
506
507
-test_expect_success 'non-empty directory blocks indirect create' '
507
+test_expect_success REFFILES 'non-empty directory blocks indirect create' '
508
prefix=refs/ne-indirect-create &&
509
git symbolic-ref $prefix/symref $prefix/foo &&
510
mkdir -p .git/$prefix/foo/bar &&
@@ -524,7 +524,7 @@ test_expect_success 'non-empty directory blocks indirect create' '
524
test_cmp expected output.err
525
'
526
527
-test_expect_success 'broken reference blocks indirect create' '
527
+test_expect_success REFFILES 'broken reference blocks indirect create' '
528
prefix=refs/broken-indirect-create &&
529
git symbolic-ref $prefix/symref $prefix/foo &&
530
echo "gobbledigook" >.git/$prefix/foo &&
@@ -543,7 +543,7 @@ test_expect_success 'broken reference blocks indirect create' '
543
test_cmp expected output.err
544
'
545
546
-test_expect_success 'no bogus intermediate values during delete' '
546
+test_expect_success REFFILES 'no bogus intermediate values during delete' '
547
prefix=refs/slow-transaction &&
548
# Set up a reference with differing loose and packed versions:
549
git update-ref $prefix/foo $C &&
@@ -600,7 +600,7 @@ test_expect_success 'no bogus intermediate values during delete' '
600
test_must_fail git rev-parse --verify --quiet $prefix/foo
601
'
602
603
-test_expect_success 'delete fails cleanly if packed-refs file is locked' '
603
+test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' '
604
prefix=refs/locked-packed-refs &&
605
# Set up a reference with differing loose and packed versions:
606
git update-ref $prefix/foo $C &&
@@ -616,7 +616,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '
616
test_cmp unchanged actual
617
'
618
619
-test_expect_success 'delete fails cleanly if packed-refs.new write fails' '
619
+test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' '
620
# Setup and expectations are similar to the test above.
621
prefix=refs/failed-packed-refs &&
622
git update-ref $prefix/foo $C &&