From: Arjen Laarhoven Date: Thu, 16 Aug 2007 22:02:17 +0000 (+0200) Subject: t1301-shared-repo.sh: fix 'stat' portability issue X-Git-Tag: v1.5.3-rc6~31 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=19b28bf5454380f9f65063e8bc3cdee669e731a9;p=git.git t1301-shared-repo.sh: fix 'stat' portability issue The t1301-shared-repo.sh testscript uses /usr/bin/stat to get the file mode, which isn't portable. Implement the test in shell using 'ls' as shown by Junio. Signed-off-by: Arjen Laarhoven Signed-off-by: Junio C Hamano --- diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh index bb5f30220..6bfe19a4e 100755 --- a/t/t1301-shared-repo.sh +++ b/t/t1301-shared-repo.sh @@ -21,7 +21,16 @@ test_expect_success 'update-server-info honors core.sharedRepository' ' git commit -m a1 && umask 0277 && git update-server-info && - test 444 = $(stat -c %a .git/info/refs) + actual="$(ls -l .git/info/refs)" && + case "$actual" in + -r--r--r--*) + : happy + ;; + *) + echo Oops, .git/info/refs is not 0444 + false + ;; + esac ' test_done