From 6e03668c415c83a8a83218fcb96dc430d9eebaed Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Wed, 25 Nov 2020 09:05:18 -0800 Subject: Change the example githook to remove a level of indirection. --- olamic-worker | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'olamic-worker') diff --git a/olamic-worker b/olamic-worker index 942151a..c9a1bd0 100755 --- a/olamic-worker +++ b/olamic-worker @@ -31,21 +31,26 @@ while true; do set +e ( - set -ex + set -e - GIT_DIR=cache.git git fetch "$GIT_REPO" "$GIT_OBJECT" + ( + set -x + + GIT_DIR=cache.git git fetch "$GIT_REPO" "$GIT_OBJECT" - rm -rf work - mkdir work - cd work + rm -rf work + mkdir work + cd work - git clone --shared "$OLAMIC_WORKER_DIR"/cache.git checkout - cd checkout - git config advice.detachedHead false - git checkout -f "$GIT_OBJECT" + git clone --shared "$OLAMIC_WORKER_DIR"/cache.git checkout + cd checkout + git config advice.detachedHead false + git checkout -f "$GIT_OBJECT" + ) ( - eval "$TASK_SCRIPT" + cd work/checkout + eval "set -x; $TASK_SCRIPT" ) ) 2>&1 | tee log STATUS="$?" -- cgit v1.2.3