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>
This commit is contained in:
Denton Liu 2019-11-27 11:53:52 -08:00 committed by Junio C Hamano
parent d2eee32a89
commit 17a4ae92ea

View File

@ -106,7 +106,7 @@ test_expect_success 'packed obs in alt ODB are repacked even when local repo is
mv .git/objects/pack/* alt_objects/pack && mv .git/objects/pack/* alt_objects/pack &&
git repack -a && git repack -a &&
myidx=$(ls -1 .git/objects/pack/*.idx) && myidx=$(ls -1 .git/objects/pack/*.idx) &&
test -f "$myidx" && test_path_is_file "$myidx" &&
for p in alt_objects/pack/*.idx for p in alt_objects/pack/*.idx
do do
git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p" 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
git repack && git repack &&
git repack -a -d && git repack -a -d &&
myidx=$(ls -1 .git/objects/pack/*.idx) && myidx=$(ls -1 .git/objects/pack/*.idx) &&
test -f "$myidx" && test_path_is_file "$myidx" &&
for p in alt_objects/pack/*.idx for p in alt_objects/pack/*.idx
do do
git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p" 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' '
for p in alt_objects/pack/*.pack for p in alt_objects/pack/*.pack
do do
base_name=$(basename $p .pack) && base_name=$(basename $p .pack) &&
if test -f alt_objects/pack/$base_name.keep if test_path_is_file alt_objects/pack/$base_name.keep
then then
rm alt_objects/pack/$base_name.keep rm alt_objects/pack/$base_name.keep
else else
@ -157,7 +157,7 @@ test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
done && done &&
git repack -a -d && git repack -a -d &&
myidx=$(ls -1 .git/objects/pack/*.idx) && myidx=$(ls -1 .git/objects/pack/*.idx) &&
test -f "$myidx" && test_path_is_file "$myidx" &&
for p in alt_objects/pack/*.idx for p in alt_objects/pack/*.idx
do do
git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p" git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p"