From c4f983bfbb725052f7ab24545d58f1ac92a73ece Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 1 May 2021 18:12:53 +0200 Subject: fix define variable before use, and shorten internal variable while at it --- lib/gitolite3/hooks/common/post-receive | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/gitolite3/hooks') 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" -- cgit v1.2.3