Skip to content

Commit

Permalink
t1301-shared-repo.sh: fix 'stat' portability issue
Browse files Browse the repository at this point in the history
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 <arjen@yaph.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Arjen Laarhoven authored and Junio C Hamano committed Aug 16, 2007
1 parent 13cc4c8 commit 19b28bf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion t/t1301-shared-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 19b28bf

Please sign in to comment.