blob: 4031e939423ecfca0e97bb394232117cb1560709 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#!/bin/sh
die() { echo "$@" >&2; exit 1; }
# ----------
# if GL_BINDIR was not passed in, find it
[ -z "$GL_BINDIR" ] &&
GL_BINDIR=` perl -ne 'print($1), exit if /^command="(.+?)\/gl-(time|auth-command) /' < $HOME/.ssh/authorized_keys`
# GL_BINDIR still not known? we have a problem...
[ -z "$GL_BINDIR" ] && {
echo "
Unable to determine correct path for gitolite scripts from the authkeys file.
Perhaps you haven't installed gitolite yet?
Or perhaps this is an HTTP mode install? If so, please set the GL_BINDIR
environment variable to the full path of the gitolite scripts, then re-try
this command. For example (if you followed doc/http-backend.mkd precisely):
GL_BINDIR=/var/www/gitolite-home/bin $0 $@
"
exit 1
}
# ----------
get_rc_val() {
$GL_BINDIR/gl-query-rc $1
}
# bypass the update hook
export GL_BYPASS_UPDATE_HOOK
GL_BYPASS_UPDATE_HOOK=1
# for normal repos, the GL_BYPASS_UPDATE_HOOK above suffices, and in fact you
# don't even need this program. But for the gitolite-admin repo, the
# post-update hook will also get called, which then needs these:
export GL_RC
export GL_BINDIR
export GL_ADMINDIR
GL_RC=`get_rc_val GL_RC 2>/dev/null`
[ -z "$GL_RC" ] && die "hmm weird... GL_RC is undefined; ABORTING"
GL_BINDIR=` get_rc_val GL_BINDIR `
GL_ADMINDIR=`get_rc_val GL_ADMINDIR`
# and finally:
git push "$@"
|