Skip to content

Commit 17a4ae9

Browse files
Denton-Lgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d2eee32 commit 17a4ae9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t7700-repack.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ test_expect_success 'packed obs in alt ODB are repacked even when local repo is
106106
mv .git/objects/pack/* alt_objects/pack &&
107107
git repack -a &&
108108
myidx=$(ls -1 .git/objects/pack/*.idx) &&
109-
test -f "$myidx" &&
109+
test_path_is_file "$myidx" &&
110110
for p in alt_objects/pack/*.idx
111111
do
112112
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
129129
git repack &&
130130
git repack -a -d &&
131131
myidx=$(ls -1 .git/objects/pack/*.idx) &&
132-
test -f "$myidx" &&
132+
test_path_is_file "$myidx" &&
133133
for p in alt_objects/pack/*.idx
134134
do
135135
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' '
148148
for p in alt_objects/pack/*.pack
149149
do
150150
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
152152
then
153153
rm alt_objects/pack/$base_name.keep
154154
else
@@ -157,7 +157,7 @@ test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
157157
done &&
158158
git repack -a -d &&
159159
myidx=$(ls -1 .git/objects/pack/*.idx) &&
160-
test -f "$myidx" &&
160+
test_path_is_file "$myidx" &&
161161
for p in alt_objects/pack/*.idx
162162
do
163163
git verify-pack -v $p | sed -n -e "/^[0-9a-f]\{40\}/p"

0 commit comments

Comments
 (0)