aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSitaram Chamarty <sitaram@atc.tcs.com>2010-04-20 19:49:44 +0530
committerSitaram Chamarty <sitaram@atc.tcs.com>2010-04-20 19:49:44 +0530
commit2cc8d0ba9a0c20bb05239508ca1a2e528678146d (patch)
treeb935a7bed1f5952a79a5ed324c6ad44d683b0de6
parentWARNING: WE NOW REFUSE TO RUN IF GIT ON THE SERVER IS < 1.6.2 (diff)
parent(security) a different fix in place of 5fd9328 (diff)
downloadgitolite-gentoo-2cc8d0ba9a0c20bb05239508ca1a2e528678146d.tar.gz
gitolite-gentoo-2cc8d0ba9a0c20bb05239508ca1a2e528678146d.tar.bz2
gitolite-gentoo-2cc8d0ba9a0c20bb05239508ca1a2e528678146d.zip
Merge branch 'master' into pu
-rwxr-xr-xhooks/gitolite-admin/post-update12
1 files changed, 10 insertions, 2 deletions
diff --git a/hooks/gitolite-admin/post-update b/hooks/gitolite-admin/post-update
index 891c273..0d1ba99 100755
--- a/hooks/gitolite-admin/post-update
+++ b/hooks/gitolite-admin/post-update
@@ -1,9 +1,17 @@
#!/bin/sh
+# ensure that the admin is not sneaking in src/ and hooks/ :)
+GIT_WORK_TREE=$GL_ADMINDIR git ls-tree --name-only master |
+ perl -lne 'exit 1 if /^(src|hooks)$/' || {
+ echo "*** ERROR ***" >&2
+ echo "no files/dirs called 'src' or 'hooks' are allowed, sorry" >&2
+ echo "until those files are deleted, the post-update hook will not run" >&2
+ exit 1
+ }
+
# checkout the master branch to $GL_ADMINDIR
# (the GL_ADMINDIR env var would have been set by gl-auth-command)
-GIT_WORK_TREE=$GL_ADMINDIR git checkout -f master -- \
- `git ls-tree --name-only master | perl -lne 'print unless /^(src|hooks)$/'`
+GIT_WORK_TREE=$GL_ADMINDIR git checkout -f master
od=$PWD
cd $GL_ADMINDIR