t1400: use test_path_is_* helpers

Signed-off-by: Kyle Meyer <kyle@kyleam.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kyle Meyer committed Mar 20, 2017 at 20:56 UTC cd81af4bd7f8d08b4d344e4274a78aabedfd49e2
1 file changed +22 -22
t/t1400-update-ref.sh
+22 -22
@@ -49,7 +49,7 @@ test_expect_success "fail to delete $m with stale ref" '
49 '
50 test_expect_success "delete $m" '
51 git update-ref -d $m $B &&
52 - ! test -f .git/$m
52 + test_path_is_missing .git/$m
53 '
54 rm -f .git/$m
55
@@ -57,7 +57,7 @@ test_expect_success "delete $m without oldvalue verification" "
57 git update-ref $m $A &&
58 test $A = \$(cat .git/$m) &&
59 git update-ref -d $m &&
60 - ! test -f .git/$m
60 + test_path_is_missing .git/$m
61 "
62 rm -f .git/$m
63
@@ -81,7 +81,7 @@ test_expect_success "fail to delete $m (by HEAD) with stale ref" '
81 '
82 test_expect_success "delete $m (by HEAD)" '
83 git update-ref -d HEAD $B &&
84 - ! test -f .git/$m
84 + test_path_is_missing .git/$m
85 '
86 rm -f .git/$m
87
@@ -89,7 +89,7 @@ test_expect_success "deleting current branch adds message to HEAD's log" '
89 git update-ref $m $A &&
90 git symbolic-ref HEAD $m &&
91 git update-ref -m delete-$m -d $m &&
92 - ! test -f .git/$m &&
92 + test_path_is_missing .git/$m &&
93 grep "delete-$m$" .git/logs/HEAD
94 '
95 rm -f .git/$m
@@ -98,7 +98,7 @@ test_expect_success "deleting by HEAD adds message to HEAD's log" '
98 git update-ref $m $A &&
99 git symbolic-ref HEAD $m &&
100 git update-ref -m delete-by-head -d HEAD &&
101 - ! test -f .git/$m &&
101 + test_path_is_missing .git/$m &&
102 grep "delete-by-head$" .git/logs/HEAD
103 '
104 rm -f .git/$m
@@ -190,14 +190,14 @@ test_expect_success \
190 test_expect_success "delete $m (by HEAD) should remove both packed and loose $m" '
191 git update-ref -d HEAD $B &&
192 ! grep "$m" .git/packed-refs &&
193 - ! test -f .git/$m
193 + test_path_is_missing .git/$m
194 '
195 rm -f .git/$m
196
197 cp -f .git/HEAD .git/HEAD.orig
198 test_expect_success "delete symref without dereference" '
199 git update-ref --no-deref -d HEAD &&
200 - ! test -f .git/HEAD
200 + test_path_is_missing .git/HEAD
201 '
202 cp -f .git/HEAD.orig .git/HEAD
203
@@ -207,7 +207,7 @@ test_expect_success "delete symref without dereference when the referred ref is
207 git commit -m foo &&
208 git pack-refs --all &&
209 git update-ref --no-deref -d HEAD &&
210 - ! test -f .git/HEAD
210 + test_path_is_missing .git/HEAD
211 '
212 cp -f .git/HEAD.orig .git/HEAD
213 git update-ref -d $m
@@ -242,7 +242,7 @@ test_expect_success '(not) create HEAD with old sha1' "
242 test_must_fail git update-ref HEAD $A $B
243 "
244 test_expect_success "(not) prior created .git/$m" "
245 - ! test -f .git/$m
245 + test_path_is_missing .git/$m
246 "
247 rm -f .git/$m
248
@@ -280,13 +280,13 @@ test_expect_success \
280 test_expect_success "empty directory removal" '
281 git branch d1/d2/r1 HEAD &&
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 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 '
291
292 test_expect_success "symref empty directory removal" '
@@ -294,14 +294,14 @@ test_expect_success "symref empty directory removal" '
294 git branch e1/r2 HEAD &&
295 git checkout e1/e2/r1 &&
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 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 '
306
307 cat >expect <<EOF