2010-08-10 10:12:52 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# gitolite mirroring
|
|
|
|
|
|
|
|
# please see doc/mirroring.mkd for instructions on how to use this
|
|
|
|
|
2011-03-16 14:51:31 +01:00
|
|
|
# flush STDIN coming from git; we have no use for that info in this hook but
|
|
|
|
# if you don't do this, git-shell sometimes dies of a signal 13 (SIGPIPE)
|
|
|
|
[ -t 0 ] || cat >/dev/null
|
|
|
|
|
2010-08-10 10:12:52 +02:00
|
|
|
if [ -n "$GL_SLAVES" ]
|
|
|
|
then
|
|
|
|
for mirror in $GL_SLAVES
|
|
|
|
do
|
|
|
|
if git push --mirror $mirror:$GL_REPO.git
|
|
|
|
then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
ssh $mirror mkdir -p $GL_REPO.git
|
|
|
|
ssh $mirror git init --bare $GL_REPO.git
|
2011-03-16 14:51:31 +01:00
|
|
|
ssh $mirror "cd $GL_REPO.git; git config receive.fsckObjects true"
|
2010-08-10 10:12:52 +02:00
|
|
|
git push --mirror $mirror:$GL_REPO.git ||
|
|
|
|
echo "WARNING: mirror push to $mirror failed"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi >&2
|