@@ -49,15 +49,15 @@ test_expect_success "fail to delete $m with stale ref" '
49
49
'
50
50
test_expect_success " delete $m " '
51
51
git update-ref -d $m $B &&
52
- ! test -f .git/$m
52
+ test_path_is_missing .git/$m
53
53
'
54
54
rm -f .git/$m
55
55
56
56
test_expect_success " delete $m without oldvalue verification" "
57
57
git update-ref $m $A &&
58
58
test $A = \$ (cat .git/$m ) &&
59
59
git update-ref -d $m &&
60
- ! test -f .git/$m
60
+ test_path_is_missing .git/$m
61
61
"
62
62
rm -f .git/$m
63
63
@@ -81,15 +81,15 @@ test_expect_success "fail to delete $m (by HEAD) with stale ref" '
81
81
'
82
82
test_expect_success " delete $m (by HEAD)" '
83
83
git update-ref -d HEAD $B &&
84
- ! test -f .git/$m
84
+ test_path_is_missing .git/$m
85
85
'
86
86
rm -f .git/$m
87
87
88
88
test_expect_success " deleting current branch adds message to HEAD's log" '
89
89
git update-ref $m $A &&
90
90
git symbolic-ref HEAD $m &&
91
91
git update-ref -m delete-$m -d $m &&
92
- ! test -f .git/$m &&
92
+ test_path_is_missing .git/$m &&
93
93
grep "delete-$m$" .git/logs/HEAD
94
94
'
95
95
rm -f .git/$m
@@ -98,7 +98,7 @@ test_expect_success "deleting by HEAD adds message to HEAD's log" '
98
98
git update-ref $m $A &&
99
99
git symbolic-ref HEAD $m &&
100
100
git update-ref -m delete-by-head -d HEAD &&
101
- ! test -f .git/$m &&
101
+ test_path_is_missing .git/$m &&
102
102
grep "delete-by-head$" .git/logs/HEAD
103
103
'
104
104
rm -f .git/$m
@@ -190,14 +190,14 @@ test_expect_success \
190
190
test_expect_success " delete $m (by HEAD) should remove both packed and loose $m " '
191
191
git update-ref -d HEAD $B &&
192
192
! grep "$m" .git/packed-refs &&
193
- ! test -f .git/$m
193
+ test_path_is_missing .git/$m
194
194
'
195
195
rm -f .git/$m
196
196
197
197
cp -f .git/HEAD .git/HEAD.orig
198
198
test_expect_success " delete symref without dereference" '
199
199
git update-ref --no-deref -d HEAD &&
200
- ! test -f .git/HEAD
200
+ test_path_is_missing .git/HEAD
201
201
'
202
202
cp -f .git/HEAD.orig .git/HEAD
203
203
@@ -207,7 +207,7 @@ test_expect_success "delete symref without dereference when the referred ref is
207
207
git commit -m foo &&
208
208
git pack-refs --all &&
209
209
git update-ref --no-deref -d HEAD &&
210
- ! test -f .git/HEAD
210
+ test_path_is_missing .git/HEAD
211
211
'
212
212
cp -f .git/HEAD.orig .git/HEAD
213
213
git update-ref -d $m
@@ -242,7 +242,7 @@ test_expect_success '(not) create HEAD with old sha1' "
242
242
test_must_fail git update-ref HEAD $A $B
243
243
"
244
244
test_expect_success " (not) prior created .git/$m " "
245
- ! test -f .git/$m
245
+ test_path_is_missing .git/$m
246
246
"
247
247
rm -f .git/$m
248
248
@@ -280,28 +280,28 @@ test_expect_success \
280
280
test_expect_success " empty directory removal" '
281
281
git branch d1/d2/r1 HEAD &&
282
282
git branch d1/r2 HEAD &&
283
- test -f .git/refs/heads/d1/d2/r1 &&
284
- test -f .git/logs/refs/heads/d1/d2/r1 &&
283
+ test_path_is_file .git/refs/heads/d1/d2/r1 &&
284
+ test_path_is_file .git/logs/refs/heads/d1/d2/r1 &&
285
285
git branch -d d1/d2/r1 &&
286
- ! test -e .git/refs/heads/d1/d2 &&
287
- ! test -e .git/logs/refs/heads/d1/d2 &&
288
- test -f .git/refs/heads/d1/r2 &&
289
- test -f .git/logs/refs/heads/d1/r2
286
+ test_path_is_missing .git/refs/heads/d1/d2 &&
287
+ test_path_is_missing .git/logs/refs/heads/d1/d2 &&
288
+ test_path_is_file .git/refs/heads/d1/r2 &&
289
+ test_path_is_file .git/logs/refs/heads/d1/r2
290
290
'
291
291
292
292
test_expect_success " symref empty directory removal" '
293
293
git branch e1/e2/r1 HEAD &&
294
294
git branch e1/r2 HEAD &&
295
295
git checkout e1/e2/r1 &&
296
296
test_when_finished "git checkout master" &&
297
- test -f .git/refs/heads/e1/e2/r1 &&
298
- test -f .git/logs/refs/heads/e1/e2/r1 &&
297
+ test_path_is_file .git/refs/heads/e1/e2/r1 &&
298
+ test_path_is_file .git/logs/refs/heads/e1/e2/r1 &&
299
299
git update-ref -d HEAD &&
300
- ! test -e .git/refs/heads/e1/e2 &&
301
- ! test -e .git/logs/refs/heads/e1/e2 &&
302
- test -f .git/refs/heads/e1/r2 &&
303
- test -f .git/logs/refs/heads/e1/r2 &&
304
- test -f .git/logs/HEAD
300
+ test_path_is_missing .git/refs/heads/e1/e2 &&
301
+ test_path_is_missing .git/logs/refs/heads/e1/e2 &&
302
+ test_path_is_file .git/refs/heads/e1/r2 &&
303
+ test_path_is_file .git/logs/refs/heads/e1/r2 &&
304
+ test_path_is_file .git/logs/HEAD
305
305
'
306
306
307
307
cat > expect << EOF
0 commit comments