2010-08-10 10:12:52 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
export GL_BYPASS_UPDATE_HOOK
|
|
|
|
GL_BYPASS_UPDATE_HOOK=1
|
|
|
|
|
2011-01-15 16:39:56 +01:00
|
|
|
get_rc_val() {
|
|
|
|
${0%/*}/gl-query-rc $1
|
|
|
|
}
|
|
|
|
|
|
|
|
REPO_BASE=$( get_rc_val REPO_BASE)
|
|
|
|
REPO_UMASK=$(get_rc_val REPO_UMASK)
|
|
|
|
|
2010-10-03 05:38:34 +02:00
|
|
|
umask $REPO_UMASK
|
|
|
|
|
2010-08-10 10:12:52 +02:00
|
|
|
if echo $SSH_ORIGINAL_COMMAND | egrep git-upload\|git-receive >/dev/null
|
|
|
|
then
|
|
|
|
|
|
|
|
# the (special) admin post-update hook needs these, so we cheat
|
2011-03-15 13:35:06 +01:00
|
|
|
export GL_RC
|
2010-08-10 10:12:52 +02:00
|
|
|
export GL_ADMINDIR
|
|
|
|
export GL_BINDIR
|
2011-03-15 13:35:06 +01:00
|
|
|
GL_RC=$( get_rc_val GL_RC)
|
2011-01-15 16:39:56 +01:00
|
|
|
GL_ADMINDIR=$(get_rc_val GL_ADMINDIR)
|
|
|
|
GL_BINDIR=$( get_rc_val GL_BINDIR)
|
2010-08-10 10:12:52 +02:00
|
|
|
|
2010-12-24 06:55:39 +01:00
|
|
|
SSH_ORIGINAL_COMMAND=`echo $SSH_ORIGINAL_COMMAND | sed -e "s:':'$REPO_BASE/:"`
|
2010-08-10 10:12:52 +02:00
|
|
|
exec git shell -c "$SSH_ORIGINAL_COMMAND"
|
|
|
|
else
|
|
|
|
bash -c "cd $REPO_BASE; $SSH_ORIGINAL_COMMAND"
|
|
|
|
fi
|