summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2021-05-01 18:12:53 +0200
committerJonas Smedegaard <dr@jones.dk>2021-05-01 18:12:53 +0200
commitc4f983bfbb725052f7ab24545d58f1ac92a73ece (patch)
tree65a0108f5d8a5e15e2fce6b4752f22d79d2cc565
parent4f728070b7e7be3301bc66dc24894df12f4f9b14 (diff)
fix define variable before use, and shorten internal variable while at it
-rwxr-xr-xlib/gitolite3/hooks/common/post-receive6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitolite3/hooks/common/post-receive b/lib/gitolite3/hooks/common/post-receive
index 9342075..ab100d9 100755
--- a/lib/gitolite3/hooks/common/post-receive
+++ b/lib/gitolite3/hooks/common/post-receive
@@ -7,7 +7,9 @@
set -eu
-[ -n "$GL_OPTION_WEB_BRANCH" ] || exit 0
+WEB_BRANCH=${GL_OPTION_WEB_BRANCH:-}
+
+[ -n "$WEB_BRANCH" ] || exit 0
# which git branch to check out
WEB_BASEDIR=${GL_OPTION_WEB_BASEDIR:-/var/www/gitolite3}
@@ -18,7 +20,7 @@ export GIT_WORK_TREE
pwd
echo "Checking out content to $GIT_WORK_TREE ..."
-git checkout -f "$GL_OPTION_WEB_BRANCH"
+git checkout -f "$WEB_BRANCH"
chmod -R u=rw,go=r,a+X "$GIT_WORK_TREE"