2009-10-02 19:53:52 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-04-20 15:31:05 +02:00
|
|
|
# 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
|
|
|
|
}
|
|
|
|
|
2009-10-03 09:47:02 +02:00
|
|
|
# checkout the master branch to $GL_ADMINDIR
|
2009-12-15 08:05:48 +01:00
|
|
|
# (the GL_ADMINDIR env var would have been set by gl-auth-command)
|
2010-04-20 15:31:05 +02:00
|
|
|
GIT_WORK_TREE=$GL_ADMINDIR git checkout -f master
|
2009-10-03 09:47:02 +02:00
|
|
|
|
2010-03-30 14:23:40 +02:00
|
|
|
od=$PWD
|
2009-10-03 09:47:02 +02:00
|
|
|
cd $GL_ADMINDIR
|
2009-12-15 08:05:48 +01:00
|
|
|
$GL_BINDIR/gl-compile-conf
|
2010-03-16 14:56:26 +01:00
|
|
|
|
2010-03-30 14:23:40 +02:00
|
|
|
cd $od
|
2010-03-17 16:06:51 +01:00
|
|
|
|
2010-04-13 14:56:34 +02:00
|
|
|
ADMIN_POST_UPDATE_CHAINS_TO=` cd;perl -e 'do ".gitolite.rc"; print $ADMIN_POST_UPDATE_CHAINS_TO'`
|
|
|
|
[ -n "$ADMIN_POST_UPDATE_CHAINS_TO" ] || ADMIN_POST_UPDATE_CHAINS_TO=hooks/post-update.secondary
|
|
|
|
|
|
|
|
if [ -f $ADMIN_POST_UPDATE_CHAINS_TO ] || [ -L $ADMIN_POST_UPDATE_CHAINS_TO ]
|
2010-03-16 14:56:26 +01:00
|
|
|
then
|
2010-04-13 14:56:34 +02:00
|
|
|
exec $ADMIN_POST_UPDATE_CHAINS_TO "$@"
|
2010-03-16 14:56:26 +01:00
|
|
|
fi
|