aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rwxr-xr-xbin/post-receive7
-rwxr-xr-xbin/post-update16
3 files changed, 31 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index b869918..71eb0e1 100644
--- a/Makefile
+++ b/Makefile
@@ -57,3 +57,11 @@ clean:
rm -rf ssl
rm -rf modules
git checkout modules
+
+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
diff --git a/bin/post-receive b/bin/post-receive
new file mode 100755
index 0000000..996189d
--- /dev/null
+++ b/bin/post-receive
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+cd ..
+unset GIT_DIR
+
+git checkout -f
+git submodule update --init --recursive
diff --git a/bin/post-update b/bin/post-update
new file mode 100755
index 0000000..48a6a16
--- /dev/null
+++ b/bin/post-update
@@ -0,0 +1,16 @@
+#!/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