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:
authorDenton Liu <liu.denton@gmail.com>2019-11-13 02:07:55 +0300
committerJunio C Hamano <gitster@pobox.com>2019-11-21 03:41:51 +0300
commitceeef863defcb3d48e32915b37f2d748708c9fd4 (patch)
tree5cc03805b1b79920bfd6ed6e273fd812b3273d18 /t/t5520-pull.sh
parent4c8b046f82cbc468fc28b6e52883a15ee2942ec7 (diff)
t5520: replace test -f with test-lib functions
Although `test -f` has the same functionality as test_path_is_file(), in the case where test_path_is_file() fails, we get much better debugging information. Replace `test -f` with test_path_is_file() so that future developers will have a better experience debugging these test cases. Also, in the case of `! test -f`, not only should that path not be a file, it shouldn't exist at all so replace it with test_path_is_missing(). Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5520-pull.sh')
-rwxr-xr-xt/t5520-pull.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 55560ce3cd..004d5884cd 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -39,8 +39,8 @@ test_expect_success 'pulling into void' '
cd cloned &&
git pull ..
) &&
- test -f file &&
- test -f cloned/file &&
+ test_path_is_file file &&
+ test_path_is_file cloned/file &&
test_cmp file cloned/file
'
@@ -50,8 +50,8 @@ test_expect_success 'pulling into void using master:master' '
cd cloned-uho &&
git pull .. master:master
) &&
- test -f file &&
- test -f cloned-uho/file &&
+ test_path_is_file file &&
+ test_path_is_file cloned-uho/file &&
test_cmp file cloned-uho/file
'
@@ -99,7 +99,7 @@ test_expect_success 'pulling into void must not create an octopus' '
(
cd cloned-octopus &&
test_must_fail git pull .. master master &&
- ! test -f file
+ test_path_is_missing file
)
'