aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjen Laarhoven <arjen@yaph.org>2007-04-07 01:49:03 +0200
committerJunio C Hamano <junkio@cox.net>2007-04-06 21:19:28 -0700
commitd93f7c1817f8b9e8bbb2e8ed70e87e84bc55b9f2 (patch)
treed81b6f3c3a2ffce84de6c8c6bb02b31e349f7ff0
parent4c84f0dcc630817aaf71049163ee63b96d543a38 (diff)
downloadgit-d93f7c1817f8b9e8bbb2e8ed70e87e84bc55b9f2.tar.gz
git-d93f7c1817f8b9e8bbb2e8ed70e87e84bc55b9f2.tar.xz
t5300-pack-object.sh: portability issue using /usr/bin/stat
In the test 'compare delta flavors', /usr/bin/stat is used to get file size. This isn't portable. There already is a dependency on Perl, use its '-s' operator to get the file size. Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xt/t5300-pack-object.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index 35e036a86..083095f7f 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -123,11 +123,12 @@ test_expect_success \
done'
cd "$TRASH"
-test_expect_success \
- 'compare delta flavors' \
- 'size_2=`stat -c "%s" test-2-${packname_2}.pack` &&
- size_3=`stat -c "%s" test-3-${packname_3}.pack` &&
- test $size_2 -gt $size_3'
+test_expect_success 'compare delta flavors' '
+ perl -e '\''
+ defined($_ = -s $_) or die for @ARGV;
+ exit 1 if $ARGV[0] <= $ARGV[1];
+ '\'' test-2-$packname_2.pack test-3-$packname_3.pack
+'
rm -fr .git2
mkdir .git2