From: Cache do Fluxo Date: Mon, 1 Feb 2016 00:06:40 +0000 (-0200) Subject: Support post-receive hook only X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=82103c29ca0f94f6df43e6b81fd57fa170aa985f;p=cache.git Support post-receive hook only --- diff --git a/Makefile b/Makefile index ef400ad..721134d 100644 --- a/Makefile +++ b/Makefile @@ -22,12 +22,7 @@ web_deploy: git push www #@rsync -avz --delete www/ blog:/var/sites/blog/www/ -post_update: - git config receive.denyCurrentBranch ignore - cd .git/hooks && ln -sf ../../bin/post-update - post_receive: - git config receive.denyCurrentBranch ignore cd .git/hooks && ln -sf ../../bin/post-receive whoami: diff --git a/bin/post-receive b/bin/post-receive index 996189d..be32fee 100755 --- a/bin/post-receive +++ b/bin/post-receive @@ -1,7 +1,20 @@ #!/bin/sh +# +# Post-receive git hook +# cd .. unset GIT_DIR -git checkout -f +if [ -d ".git/annex" ]; then + git annex sync +else + git config receive.denyCurrentBranch ignore + git reset HEAD + git checkout -f +fi + git submodule update --init --recursive + +cd - +exec git update-server-info diff --git a/bin/post-update b/bin/post-update deleted file mode 100755 index 48a6a16..0000000 --- a/bin/post-update +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -cd .. -unset GIT_DIR - -if [ -d ".git/annex" ]; then - git annex sync -else - git reset HEAD - git checkout -f -fi - -git submodule update --init --recursive - -cd - -exec git update-server-info