summaryrefslogtreecommitdiff
path: root/t/t1301-shared-repo.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-06 07:42:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-04-06 07:42:52 (GMT)
commit03a39a91842cf745e5fc27dbd6485aad44d839a4 (patch)
treed4536e303954fc52c189fc3140c46810e9832766 /t/t1301-shared-repo.sh
parentccc852c37751c7bc8f81bfb71e6722291270bca5 (diff)
parent1b89eaa4bef44ef84f2af611d5db8727e3be266c (diff)
downloadgit-03a39a91842cf745e5fc27dbd6485aad44d839a4.zip
git-03a39a91842cf745e5fc27dbd6485aad44d839a4.tar.gz
git-03a39a91842cf745e5fc27dbd6485aad44d839a4.tar.bz2
Merge branch 'jc/shared-literally'
* jc/shared-literally: t1301: loosen test for forced modes set_shared_perm(): sometimes we know what the final mode bits should look like move_temp_to_file(): do not forget to chmod() in "Coda hack" codepath Move chmod(foo, 0444) into move_temp_to_file() "core.sharedrepository = 0mode" should set, not loosen
Diffstat (limited to 't/t1301-shared-repo.sh')
-rwxr-xr-xt/t1301-shared-repo.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index dc44854..750fbb3 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -126,4 +126,41 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
esac
'
+test_expect_success 'forced modes' '
+ mkdir -p templates/hooks &&
+ echo update-server-info >templates/hooks/post-update &&
+ chmod +x templates/hooks/post-update &&
+ echo : >random-file &&
+ mkdir new &&
+ (
+ cd new &&
+ umask 002 &&
+ git init --shared=0660 --template=../templates &&
+ >frotz &&
+ git add frotz &&
+ git commit -a -m initial &&
+ git repack
+ ) &&
+ find new/.git -print |
+ xargs ls -ld >actual &&
+
+ # Everything must be unaccessible to others
+ test -z "$(sed -n -e "/^.......---/d" actual)" &&
+
+ # All directories must have either 2770 or 770
+ test -z "$(sed -n -e "/^drwxrw[sx]---/d" -e "/^d/p" actual)" &&
+
+ # post-update hook must be 0770
+ test -z "$(sed -n -e "/post-update/{
+ /^-rwxrwx---/d
+ p
+ }" actual)" &&
+
+ # All files inside objects must be 0440
+ test -z "$(sed -n -e "/objects\//{
+ /^d/d
+ /^-r--r-----/d
+ }" actual)"
+'
+
test_done