diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-04-08 23:23:41 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-04-08 23:23:41 -0700 |
commit | bff82d0cdaf29ec0f8b1f5f166100770c044388f (patch) | |
tree | 331010d5c9192dbee7da020bf416cb4c304e1c93 /t | |
parent | 197cf8d59c0109f486ed6b56512b3c54ea44dccd (diff) | |
parent | 1b89eaa4bef44ef84f2af611d5db8727e3be266c (diff) | |
download | git-bff82d0cdaf29ec0f8b1f5f166100770c044388f.tar.gz |
Merge branch 'jc/shared-literally' into maint
* 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')
-rwxr-xr-x | t/t1301-shared-repo.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh index 653362ba22..3c8a2373ac 100755 --- a/t/t1301-shared-repo.sh +++ b/t/t1301-shared-repo.sh @@ -126,4 +126,41 @@ test_expect_success '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 |