Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCOGONI Guillaume <cogoni.guillaume@gmail.com>2022-02-23 00:54:30 +0300
committerJunio C Hamano <gitster@pobox.com>2022-02-24 02:08:44 +0300
commitcc143f12a781afaef3de89450bc2b4d233058809 (patch)
tree58336b0ef0d1bdc6963ec217453f40aecd415b2d /t/t3903-stash.sh
parent456296b5d1f05ca16949e7d37ae87f5750118564 (diff)
tests: make the code more readable
Replace the parsing of the output of "ls -l" by test_path_is_symlink() and test_readlink(). Signed-off-by: COGONI Guillaume <cogoni.guillaume@gmail.com> Co-authored-by: BRESSAT Jonathan <git.jonathan.bressat@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3903-stash.sh')
-rwxr-xr-xt/t3903-stash.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 0a82bc857d..1855181520 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -393,7 +393,8 @@ test_expect_success SYMLINKS 'stash file to symlink' '
test_path_is_file_not_symlink file &&
test bar = "$(cat file)" &&
git stash apply &&
- case "$(ls -l file)" in *" file -> file2") :;; *) false;; esac
+ test_path_is_symlink file &&
+ test "$(test_readlink file)" = file2
'
test_expect_success SYMLINKS 'stash file to symlink (stage rm)' '
@@ -404,7 +405,8 @@ test_expect_success SYMLINKS 'stash file to symlink (stage rm)' '
test_path_is_file_not_symlink file &&
test bar = "$(cat file)" &&
git stash apply &&
- case "$(ls -l file)" in *" file -> file2") :;; *) false;; esac
+ test_path_is_symlink file &&
+ test "$(test_readlink file)" = file2
'
test_expect_success SYMLINKS 'stash file to symlink (full stage)' '
@@ -416,7 +418,8 @@ test_expect_success SYMLINKS 'stash file to symlink (full stage)' '
test_path_is_file_not_symlink file &&
test bar = "$(cat file)" &&
git stash apply &&
- case "$(ls -l file)" in *" file -> file2") :;; *) false;; esac
+ test_path_is_symlink file &&
+ test "$(test_readlink file)" = file2
'
# This test creates a commit with a symlink used for the following tests