summaryrefslogtreecommitdiff
path: root/lib/gitolite3/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitolite3/hooks')
-rwxr-xr-xlib/gitolite3/hooks/common/post-receive18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/gitolite3/hooks/common/post-receive b/lib/gitolite3/hooks/common/post-receive
index 9c9aed7..4a869f3 100755
--- a/lib/gitolite3/hooks/common/post-receive
+++ b/lib/gitolite3/hooks/common/post-receive
@@ -24,15 +24,15 @@ export GIT_WORK_TREE
pwd
echo "Checking out content to $GIT_WORK_TREE ..."
-init=1
-[ -e "$GIT_WORK_TREE" ] || init=
-
-git checkout -f "$WEB_BRANCH"
-
-chmod -R u=rw,go=r,a+X "$GIT_WORK_TREE"
-
-if [ -n "$WEB_EXEC_INIT" ] && [ -n "$init" ]; then
- ( cd "$WEB_BASEDIR" && echo "$WEB_EXEC_INIT" | sh - )
+if [ -e "$GIT_WORK_TREE" ]; then
+ git checkout -f "$WEB_BRANCH"
+ chmod -R u=rw,go=r,a+X "$GIT_WORK_TREE"
+else
+ git clone --quiet --branch "$WEB_BRANCH"
+ chmod -R u=rw,go=r,a+X "$GIT_WORK_TREE"
+ if [ -n "$WEB_EXEC_INIT" ]; then
+ ( cd "$WEB_BASEDIR" && echo "$WEB_EXEC_INIT" | sh - )
+ fi
fi
if [ -n "$WEB_EXEC" ]; then