@matheusbsbs / matheus-bagliano / commits / 17a4ae92ea
Fork 0

t7700: s/test -f/test_path_is_file/

Since we have debugging-friendly alternatives to `test -f`, replace instances of `test -f` with `test_path_is_file` so that if a command ever fails, we get better debugging information. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Nov 27, 2019 at 11:53 UTC 17a4ae92eaa2f9614d739c11c3b60932a0f272b9
1 file changed +4 -4
t/t7700-repack.sh
+4 -4
@@ -106,7 +106,7 @@ test_expect_success 'packed obs in alt ODB are repacked even when local repo is
106 mv .git/objects/pack/* alt_objects/pack &&
107 git repack -a &&
108 myidx=$(ls -1 .git/objects/pack/*.idx) &&
109 - test -f "$myidx" &&
109 + test_path_is_file "$myidx" &&
110 for p in alt_objects/pack/*.idx
111 do
112 git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p"
@@ -129,7 +129,7 @@ test_expect_success 'packed obs in alt ODB are repacked when local repo has pack
129 git repack &&
130 git repack -a -d &&
131 myidx=$(ls -1 .git/objects/pack/*.idx) &&
132 - test -f "$myidx" &&
132 + test_path_is_file "$myidx" &&
133 for p in alt_objects/pack/*.idx
134 do
135 git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p"
@@ -148,7 +148,7 @@ test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
148 for p in alt_objects/pack/*.pack
149 do
150 base_name=$(basename $p .pack) &&
151 - if test -f alt_objects/pack/$base_name.keep
151 + if test_path_is_file alt_objects/pack/$base_name.keep
152 then
153 rm alt_objects/pack/$base_name.keep
154 else
@@ -157,7 +157,7 @@ test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
157 done &&
158 git repack -a -d &&
159 myidx=$(ls -1 .git/objects/pack/*.idx) &&
160 - test -f "$myidx" &&
160 + test_path_is_file "$myidx" &&
161 for p in alt_objects/pack/*.idx
162 do
163 git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p"