From c716dcb35d4f32cccb007fb0c8a02191d1ca86ad Mon Sep 17 00:00:00 2001 From: codl Date: Sat, 3 Feb 2018 17:05:19 +0100 Subject: [PATCH] actually just use a clone instead --- tools/post-receive.example | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/post-receive.example b/tools/post-receive.example index a7c48c2..16fea01 100755 --- a/tools/post-receive.example +++ b/tools/post-receive.example @@ -6,14 +6,14 @@ while read old new refname; do branch=$(git rev-parse --abbrev-ref=strict ${refname}) if [[ $branch == "deploy" ]]; then - #export GIT_WORK_TREE="/tmp/forget_$RANDOM" - #mkdir -p $GIT_WORK_TREE - #git checkout deploy + cd "$HOME/forget" - cd /home/codl/forget - - #(cd $GIT_WORK_TREE; git archive deploy) | tar -x - git archive deploy | tar -x + ( + unset GIT_DIR + unset GIT_WORK_TREE + git checkout deploy + git reset --hard upstream/deploy + ) ( source venv/bin/activate @@ -28,7 +28,6 @@ while read old new refname; do doit ) systemctl --user restart forget - #rm -rf $GIT_WORK_TREE fi done