Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 61e0eb9

Browse files
artagnongitster
authored andcommitted
t/am: use test_path_is_missing() where appropriate
Replace instances of ! test -d with test_path_is_missing. Signed-off-by: Ramkumar Ramachandra <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b141f3c commit 61e0eb9

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

t/t4150-am.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ test_expect_success 'am applies patch correctly' '
147147
git checkout first &&
148148
test_tick &&
149149
git am <patch1 &&
150-
! test -d .git/rebase-apply &&
150+
test_path_is_missing .git/rebase-apply &&
151151
git diff --exit-code second &&
152152
test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
153153
test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
@@ -158,7 +158,7 @@ test_expect_success 'am applies patch e-mail not in a mbox' '
158158
git reset --hard &&
159159
git checkout first &&
160160
git am patch1.eml &&
161-
! test -d .git/rebase-apply &&
161+
test_path_is_missing .git/rebase-apply &&
162162
git diff --exit-code second &&
163163
test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
164164
test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
@@ -169,7 +169,7 @@ test_expect_success 'am applies patch e-mail not in a mbox with CRLF' '
169169
git reset --hard &&
170170
git checkout first &&
171171
git am patch1-crlf.eml &&
172-
! test -d .git/rebase-apply &&
172+
test_path_is_missing .git/rebase-apply &&
173173
git diff --exit-code second &&
174174
test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
175175
test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
@@ -180,7 +180,7 @@ test_expect_success 'am applies patch e-mail with preceding whitespace' '
180180
git reset --hard &&
181181
git checkout first &&
182182
git am patch1-ws.eml &&
183-
! test -d .git/rebase-apply &&
183+
test_path_is_missing .git/rebase-apply &&
184184
git diff --exit-code second &&
185185
test "$(git rev-parse second)" = "$(git rev-parse HEAD)" &&
186186
test "$(git rev-parse second^)" = "$(git rev-parse HEAD^)"
@@ -206,7 +206,7 @@ test_expect_success 'am changes committer and keeps author' '
206206
git reset --hard &&
207207
git checkout first &&
208208
git am patch2 &&
209-
! test -d .git/rebase-apply &&
209+
test_path_is_missing .git/rebase-apply &&
210210
test "$(git rev-parse master^^)" = "$(git rev-parse HEAD^^)" &&
211211
git diff --exit-code master..HEAD &&
212212
git diff --exit-code master^..HEAD^ &&
@@ -258,7 +258,7 @@ test_expect_success 'am --keep really keeps the subject' '
258258
git reset --hard &&
259259
git checkout HEAD^ &&
260260
git am --keep patch4 &&
261-
! test -d .git/rebase-apply &&
261+
test_path_is_missing .git/rebase-apply &&
262262
git cat-file commit HEAD >actual &&
263263
grep "Re: Re: Re: \[PATCH 1/5 v2\] \[foo\] third" actual
264264
'
@@ -268,7 +268,7 @@ test_expect_success 'am --keep-non-patch really keeps the non-patch part' '
268268
git reset --hard &&
269269
git checkout HEAD^ &&
270270
git am --keep-non-patch patch4 &&
271-
! test -d .git/rebase-apply &&
271+
test_path_is_missing .git/rebase-apply &&
272272
git cat-file commit HEAD >actual &&
273273
grep "^\[foo\] third" actual
274274
'
@@ -283,7 +283,7 @@ test_expect_success 'am -3 falls back to 3-way merge' '
283283
test_tick &&
284284
git commit -m "copied stuff" &&
285285
git am -3 lorem-move.patch &&
286-
! test -d .git/rebase-apply &&
286+
test_path_is_missing .git/rebase-apply &&
287287
git diff --exit-code lorem
288288
'
289289

@@ -297,7 +297,7 @@ test_expect_success 'am -3 -p0 can read --no-prefix patch' '
297297
test_tick &&
298298
git commit -m "copied stuff" &&
299299
git am -3 -p0 lorem-zero.patch &&
300-
! test -d .git/rebase-apply &&
300+
test_path_is_missing .git/rebase-apply &&
301301
git diff --exit-code lorem
302302
'
303303

@@ -307,7 +307,7 @@ test_expect_success 'am can rename a file' '
307307
git reset --hard &&
308308
git checkout lorem^0 &&
309309
git am rename.patch &&
310-
! test -d .git/rebase-apply &&
310+
test_path_is_missing .git/rebase-apply &&
311311
git update-index --refresh &&
312312
git diff --exit-code rename
313313
'
@@ -318,7 +318,7 @@ test_expect_success 'am -3 can rename a file' '
318318
git reset --hard &&
319319
git checkout lorem^0 &&
320320
git am -3 rename.patch &&
321-
! test -d .git/rebase-apply &&
321+
test_path_is_missing .git/rebase-apply &&
322322
git update-index --refresh &&
323323
git diff --exit-code rename
324324
'
@@ -329,7 +329,7 @@ test_expect_success 'am -3 can rename a file after falling back to 3-way merge'
329329
git reset --hard &&
330330
git checkout lorem^0 &&
331331
git am -3 rename-add.patch &&
332-
! test -d .git/rebase-apply &&
332+
test_path_is_missing .git/rebase-apply &&
333333
git update-index --refresh &&
334334
git diff --exit-code rename
335335
'
@@ -358,7 +358,7 @@ test_expect_success 'am pauses on conflict' '
358358
test_expect_success 'am --skip works' '
359359
echo goodbye >expected &&
360360
git am --skip &&
361-
! test -d .git/rebase-apply &&
361+
test_path_is_missing .git/rebase-apply &&
362362
git diff --exit-code lorem2^^ -- file &&
363363
test_cmp expected another
364364
'
@@ -379,7 +379,7 @@ test_expect_success 'am --resolved works' '
379379
echo resolved >>file &&
380380
git add file &&
381381
git am --resolved &&
382-
! test -d .git/rebase-apply &&
382+
test_path_is_missing .git/rebase-apply &&
383383
test_cmp expected another
384384
'
385385

@@ -388,7 +388,7 @@ test_expect_success 'am takes patches from a Pine mailbox' '
388388
git reset --hard &&
389389
git checkout first &&
390390
cat pine patch1 | git am &&
391-
! test -d .git/rebase-apply &&
391+
test_path_is_missing .git/rebase-apply &&
392392
git diff --exit-code master^..HEAD
393393
'
394394

@@ -397,7 +397,7 @@ test_expect_success 'am fails on mail without patch' '
397397
git reset --hard &&
398398
test_must_fail git am <failmail &&
399399
git am --abort &&
400-
! test -d .git/rebase-apply
400+
test_path_is_missing .git/rebase-apply
401401
'
402402

403403
test_expect_success 'am fails on empty patch' '
@@ -406,7 +406,7 @@ test_expect_success 'am fails on empty patch' '
406406
echo "---" >>failmail &&
407407
test_must_fail git am <failmail &&
408408
git am --skip &&
409-
! test -d .git/rebase-apply
409+
test_path_is_missing .git/rebase-apply
410410
'
411411

412412
test_expect_success 'am works from stdin in subdirectory' '

0 commit comments

Comments
 (0)