Skip to content

Commit 19b28bf

Browse files
ArjenLgitster
authored andcommitted
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 <arjen@yaph.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 13cc4c8 commit 19b28bf

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

t/t1301-shared-repo.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ test_expect_success 'update-server-info honors core.sharedRepository' '
2121
git commit -m a1 &&
2222
umask 0277 &&
2323
git update-server-info &&
24-
test 444 = $(stat -c %a .git/info/refs)
24+
actual="$(ls -l .git/info/refs)" &&
25+
case "$actual" in
26+
-r--r--r--*)
27+
: happy
28+
;;
29+
*)
30+
echo Oops, .git/info/refs is not 0444
31+
false
32+
;;
33+
esac
2534
'
2635

2736
test_done

0 commit comments

Comments
 (0)