From dbbc7089ffa311515b29f22e6f08c84104f1ecdd Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Sun, 7 Sep 2014 21:59:35 +0100 Subject: [PATCH] Fix hook to run when $HOME is not explicitly set --- pre-receive | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pre-receive b/pre-receive index af15423..fe2d140 100755 --- a/pre-receive +++ b/pre-receive @@ -30,6 +30,13 @@ if [[ $? -ne 0 ]]; then exit 1 fi +if [[ "x${HOME}" == "x" ]]; then + id=`whoami` + HOME=`eval echo ~${id}` + export HOME +fi +echo "HOME is ${HOME}" 1>&2 + tmpdir=`mktemp -d` tmpfile="$tmpdir/candidate"