Skip to content

Commit

Permalink
Merge branch 'jc/shared-literally'
Browse files Browse the repository at this point in the history
* jc/shared-literally:
  t1301-shared-repo: fix forced modes test
  • Loading branch information
Junio C Hamano committed Apr 18, 2009
2 parents 1ee28e5 + 7d5a180 commit 1dd9b63
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions t/t1301-shared-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
esac
'

test_expect_success 'forced modes' '
test_expect_success POSIXPERM 'forced modes' '
mkdir -p templates/hooks &&
echo update-server-info >templates/hooks/post-update &&
chmod +x templates/hooks/post-update &&
Expand All @@ -141,11 +141,14 @@ test_expect_success 'forced modes' '
git commit -a -m initial &&
git repack
) &&
find new/.git -print |
# List repository files meant to be protected; note that
# COMMIT_EDITMSG does not matter---0mode is not about a
# repository with a work tree.
find new/.git -type f -name COMMIT_EDITMSG -prune -o -print |
xargs ls -ld >actual &&
# Everything must be unaccessible to others
test -z "$(sed -n -e "/^.......---/d" actual)" &&
test -z "$(sed -e "/^.......---/d" actual)" &&
# All directories must have either 2770 or 770
test -z "$(sed -n -e "/^drwxrw[sx]---/d" -e "/^d/p" actual)" &&
Expand All @@ -156,10 +159,11 @@ test_expect_success 'forced modes' '
p
}" actual)" &&
# All files inside objects must be 0440
# All files inside objects must be accessible by us
test -z "$(sed -n -e "/objects\//{
/^d/d
/^-r--r-----/d
/^-r.-r.----/d
p
}" actual)"
'

Expand Down

0 comments on commit 1dd9b63

Please sign in to comment.