@@ -390,21 +390,23 @@ test_expect_success SYMLINKS 'stash file to symlink' '
390
390
rm file &&
391
391
ln -s file2 file &&
392
392
git stash save "file to symlink" &&
393
- test -f file &&
393
+ test_path_is_file_not_symlink file &&
394
394
test bar = "$(cat file)" &&
395
395
git stash apply &&
396
- case "$(ls -l file)" in *" file -> file2") :;; *) false;; esac
396
+ test_path_is_symlink file &&
397
+ test "$(test_readlink file)" = file2
397
398
'
398
399
399
400
test_expect_success SYMLINKS ' stash file to symlink (stage rm)' '
400
401
git reset --hard &&
401
402
git rm file &&
402
403
ln -s file2 file &&
403
404
git stash save "file to symlink (stage rm)" &&
404
- test -f file &&
405
+ test_path_is_file_not_symlink file &&
405
406
test bar = "$(cat file)" &&
406
407
git stash apply &&
407
- case "$(ls -l file)" in *" file -> file2") :;; *) false;; esac
408
+ test_path_is_symlink file &&
409
+ test "$(test_readlink file)" = file2
408
410
'
409
411
410
412
test_expect_success SYMLINKS ' stash file to symlink (full stage)' '
@@ -413,10 +415,11 @@ test_expect_success SYMLINKS 'stash file to symlink (full stage)' '
413
415
ln -s file2 file &&
414
416
git add file &&
415
417
git stash save "file to symlink (full stage)" &&
416
- test -f file &&
418
+ test_path_is_file_not_symlink file &&
417
419
test bar = "$(cat file)" &&
418
420
git stash apply &&
419
- case "$(ls -l file)" in *" file -> file2") :;; *) false;; esac
421
+ test_path_is_symlink file &&
422
+ test "$(test_readlink file)" = file2
420
423
'
421
424
422
425
# This test creates a commit with a symlink used for the following tests
@@ -487,7 +490,7 @@ test_expect_failure 'stash directory to file' '
487
490
rm -fr dir &&
488
491
echo bar >dir &&
489
492
git stash save "directory to file" &&
490
- test -d dir &&
493
+ test_path_is_dir dir &&
491
494
test foo = "$(cat dir/file)" &&
492
495
test_must_fail git stash apply &&
493
496
test bar = "$(cat dir)" &&
@@ -500,10 +503,10 @@ test_expect_failure 'stash file to directory' '
500
503
mkdir file &&
501
504
echo foo >file/file &&
502
505
git stash save "file to directory" &&
503
- test -f file &&
506
+ test_path_is_file file &&
504
507
test bar = "$(cat file)" &&
505
508
git stash apply &&
506
- test -f file/file &&
509
+ test_path_is_file file/file &&
507
510
test foo = "$(cat file/file)"
508
511
'
509
512
0 commit comments