@matheusbsbs / matheus-bagliano / commits / a51d9e8f07
Fork 0

t1050: replace test -f with test_path_is_file

Use test_path_is_file() instead of 'test -f' for better debugging information. Signed-off-by: Rasmus Jonsson <wasmus@zom.bi> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Rasmus Jonsson committed Feb 23, 2020 at 01:50 UTC a51d9e8f07652ded830cb50187be74c1709816d8
1 file changed +6 -4
t/t1050-large.sh
+6 -4
@@ -53,7 +53,8 @@ test_expect_success 'add a large file or two' '
53 for p in .git/objects/pack/pack-*.pack
54 do
55 count=$(( $count + 1 ))
56 - if test -f "$p" && idx=${p%.pack}.idx && test -f "$idx"
56 + if test_path_is_file "$p" &&
57 + idx=${p%.pack}.idx && test_path_is_file "$idx"
58 then
59 continue
60 fi
@@ -65,7 +66,7 @@ test_expect_success 'add a large file or two' '
66 test $cnt = 2 &&
67 for l in .git/objects/??/??????????????????????????????????????
68 do
68 - test -f "$l" || continue
69 + test_path_is_file "$l" || continue
70 bad=t
71 done &&
72 test -z "$bad" &&
@@ -76,7 +77,8 @@ test_expect_success 'add a large file or two' '
77 for p in .git/objects/pack/pack-*.pack
78 do
79 count=$(( $count + 1 ))
79 - if test -f "$p" && idx=${p%.pack}.idx && test -f "$idx"
80 + if test_path_is_file "$p" &&
81 + idx=${p%.pack}.idx && test_path_is_file "$idx"
82 then
83 continue
84 fi
@@ -111,7 +113,7 @@ test_expect_success 'packsize limit' '
113 count=0 &&
114 for pi in .git/objects/pack/pack-*.idx
115 do
114 - test -f "$pi" && count=$(( $count + 1 ))
116 + test_path_is_file "$pi" && count=$(( $count + 1 ))
117 done &&
118 test $count = 2 &&
119