@@ -295,8 +295,8 @@ test_expect_success 'Rename+D/F conflict; renamed file merges + dir not in way'
295
295
git merge --strategy=recursive dir-not-in-way &&
296
296
297
297
git diff --quiet &&
298
- test -f dir &&
299
- printf "1\n2\n3\n4\n5555\n6\n7\n8\n9\n10\n11\n" >expected &&
298
+ test_path_is_file dir &&
299
+ test_write_lines 1 2 3 4 5555 6 7 8 9 10 11 >expected &&
300
300
test_cmp expected dir
301
301
'
302
302
@@ -316,8 +316,8 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' '
316
316
test_must_fail git diff --quiet &&
317
317
test_must_fail git diff --cached --quiet &&
318
318
319
- test -f dir/file-in-the-way &&
320
- test -f dir~HEAD &&
319
+ test_path_is_file dir/file-in-the-way &&
320
+ test_path_is_file dir~HEAD &&
321
321
test_cmp expected dir~HEAD
322
322
'
323
323
@@ -338,8 +338,8 @@ test_expect_success 'Same as previous, but merged other way' '
338
338
test_must_fail git diff --quiet &&
339
339
test_must_fail git diff --cached --quiet &&
340
340
341
- test -f dir/file-in-the-way &&
342
- test -f dir~renamed-file-has-no-conflicts &&
341
+ test_path_is_file dir/file-in-the-way &&
342
+ test_path_is_file dir~renamed-file-has-no-conflicts &&
343
343
test_cmp expected dir~renamed-file-has-no-conflicts
344
344
'
345
345
@@ -355,7 +355,7 @@ test_expect_success 'Rename+D/F conflict; renamed file cannot merge, dir not in
355
355
test_must_fail git diff --quiet &&
356
356
test_must_fail git diff --cached --quiet &&
357
357
358
- test -f dir &&
358
+ test_path_is_file dir &&
359
359
cat >expected <<-\EOF &&
360
360
1
361
361
2
@@ -391,8 +391,8 @@ test_expect_success 'Rename+D/F conflict; renamed file cannot merge and dir in t
391
391
test_must_fail git diff --quiet &&
392
392
test_must_fail git diff --cached --quiet &&
393
393
394
- test -f dir/file-in-the-way &&
395
- test -f dir~HEAD &&
394
+ test_path_is_file dir/file-in-the-way &&
395
+ test_path_is_file dir~HEAD &&
396
396
test_cmp expected dir~HEAD
397
397
'
398
398
@@ -409,8 +409,8 @@ test_expect_success 'Same as previous, but merged other way' '
409
409
test_must_fail git diff --quiet &&
410
410
test_must_fail git diff --cached --quiet &&
411
411
412
- test -f dir/file-in-the-way &&
413
- test -f dir~renamed-file-has-conflicts &&
412
+ test_path_is_file dir/file-in-the-way &&
413
+ test_path_is_file dir~renamed-file-has-conflicts &&
414
414
cat >expected <<-\EOF &&
415
415
1
416
416
2
@@ -463,9 +463,9 @@ test_expect_success 'both rename source and destination involved in D/F conflict
463
463
464
464
test_must_fail git diff --quiet &&
465
465
466
- test -f destdir/foo &&
467
- test -f one &&
468
- test -f destdir~HEAD &&
466
+ test_path_is_file destdir/foo &&
467
+ test_path_is_file one &&
468
+ test_path_is_file destdir~HEAD &&
469
469
test "stuff" = "$(cat destdir~HEAD)"
470
470
'
471
471
@@ -506,9 +506,9 @@ test_expect_success 'pair rename to parent of other (D/F conflicts) w/ untracked
506
506
507
507
test 4 -eq $(find . | grep -v .git | wc -l) &&
508
508
509
- test -d one &&
510
- test -f one~rename-two &&
511
- test -f two &&
509
+ test_path_is_dir one &&
510
+ test_path_is_file one~rename-two &&
511
+ test_path_is_file two &&
512
512
test "other" = $(cat one~rename-two) &&
513
513
test "stuff" = $(cat two)
514
514
'
@@ -526,8 +526,8 @@ test_expect_success 'pair rename to parent of other (D/F conflicts) w/ clean sta
526
526
527
527
test 3 -eq $(find . | grep -v .git | wc -l) &&
528
528
529
- test -f one &&
530
- test -f two &&
529
+ test_path_is_file one &&
530
+ test_path_is_file two &&
531
531
test "other" = $(cat one) &&
532
532
test "stuff" = $(cat two)
533
533
'
@@ -567,11 +567,11 @@ test_expect_success 'check handling of differently renamed file with D/F conflic
567
567
test 1 -eq "$(git ls-files -u original | wc -l)" &&
568
568
test 2 -eq "$(git ls-files -o | wc -l)" &&
569
569
570
- test -f one/file &&
571
- test -f two/file &&
572
- test -f one~HEAD &&
573
- test -f two~second-rename &&
574
- ! test -f original
570
+ test_path_is_file one/file &&
571
+ test_path_is_file two/file &&
572
+ test_path_is_file one~HEAD &&
573
+ test_path_is_file two~second-rename &&
574
+ test_path_is_missing original
575
575
'
576
576
577
577
test_expect_success ' setup rename one file to two; directories moving out of the way' '
@@ -606,9 +606,9 @@ test_expect_success 'check handling of differently renamed file with D/F conflic
606
606
test 1 -eq "$(git ls-files -u original | wc -l)" &&
607
607
test 0 -eq "$(git ls-files -o | wc -l)" &&
608
608
609
- test -f one &&
610
- test -f two &&
611
- ! test -f original
609
+ test_path_is_file one &&
610
+ test_path_is_file two &&
611
+ test_path_is_missing original
612
612
'
613
613
614
614
test_expect_success ' setup avoid unnecessary update, normal rename' '
0 commit comments