Skip to content

Commit 448cea8

Browse files
committed
Merge branch 'pb/t4200-test-path-is-helpers'
Test clean-up. * pb/t4200-test-path-is-helpers: t4200: convert test -[df] checks to test_path_* helpers
2 parents 067ee91 + d893f3e commit 448cea8

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

t/t4200-rerere.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ test_expect_success 'nothing recorded without rerere' '
7272
rm -rf .git/rr-cache &&
7373
git config rerere.enabled false &&
7474
test_must_fail git merge first &&
75-
! test -d .git/rr-cache
75+
test_path_is_missing .git/rr-cache
7676
'
7777

7878
test_expect_success 'activate rerere, old style (conflicting merge)' '
@@ -84,8 +84,8 @@ test_expect_success 'activate rerere, old style (conflicting merge)' '
8484
sha1=$(sed "s/ .*//" .git/MERGE_RR) &&
8585
rr=.git/rr-cache/$sha1 &&
8686
grep "^=======\$" $rr/preimage &&
87-
! test -f $rr/postimage &&
88-
! test -f $rr/thisimage
87+
test_path_is_missing $rr/postimage &&
88+
test_path_is_missing $rr/thisimage
8989
'
9090

9191
test_expect_success 'rerere.enabled works, too' '
@@ -110,8 +110,8 @@ test_expect_success 'set up rr-cache' '
110110

111111
test_expect_success 'rr-cache looks sane' '
112112
# no postimage or thisimage yet
113-
! test -f $rr/postimage &&
114-
! test -f $rr/thisimage &&
113+
test_path_is_missing $rr/postimage &&
114+
test_path_is_missing $rr/thisimage &&
115115
116116
# preimage has right number of lines
117117
cnt=$(sed -ne "/^<<<<<<</,/^>>>>>>>/p" $rr/preimage | wc -l) &&
@@ -167,7 +167,7 @@ test_expect_success 'first postimage wins' '
167167
git show first:a1 | sed "s/To die: t/To die! T/" >expect &&
168168
169169
git commit -q -a -m "prefer first over second" &&
170-
test -f $rr/postimage &&
170+
test_path_is_file $rr/postimage &&
171171
172172
oldmtimepost=$(test-tool chmtime --get -60 $rr/postimage) &&
173173
@@ -190,22 +190,22 @@ test_expect_success 'rerere clear' '
190190
mv $rr/postimage .git/post-saved &&
191191
echo "$sha1 a1" | tr "\012" "\000" >.git/MERGE_RR &&
192192
git rerere clear &&
193-
! test -d $rr
193+
test_path_is_missing $rr
194194
'
195195

196196
test_expect_success 'leftover directory' '
197197
git reset --hard &&
198198
mkdir -p $rr &&
199199
test_must_fail git merge first &&
200-
test -f $rr/preimage
200+
test_path_is_file $rr/preimage
201201
'
202202

203203
test_expect_success 'missing preimage' '
204204
git reset --hard &&
205205
mkdir -p $rr &&
206206
cp .git/post-saved $rr/postimage &&
207207
test_must_fail git merge first &&
208-
test -f $rr/preimage
208+
test_path_is_file $rr/preimage
209209
'
210210

211211
test_expect_success 'set up for garbage collection tests' '
@@ -230,16 +230,16 @@ test_expect_success 'set up for garbage collection tests' '
230230

231231
test_expect_success 'gc preserves young or recently used records' '
232232
git rerere gc &&
233-
test -f $rr/preimage &&
234-
test -f $rr2/preimage
233+
test_path_is_file $rr/preimage &&
234+
test_path_is_file $rr2/preimage
235235
'
236236

237237
test_expect_success 'old records rest in peace' '
238238
test-tool chmtime =$just_over_60_days_ago $rr/postimage &&
239239
test-tool chmtime =$just_over_15_days_ago $rr2/preimage &&
240240
git rerere gc &&
241-
! test -f $rr/preimage &&
242-
! test -f $rr2/preimage
241+
test_path_is_missing $rr/preimage &&
242+
test_path_is_missing $rr2/preimage
243243
'
244244

245245
rerere_gc_custom_expiry_test () {

0 commit comments

Comments
 (0)