aboutsummaryrefslogtreecommitdiffstats
path: root/git_hooks
diff options
context:
space:
mode:
Diffstat (limited to 'git_hooks')
-rwxr-xr-xgit_hooks/pre-commit18
1 files changed, 18 insertions, 0 deletions
diff --git a/git_hooks/pre-commit b/git_hooks/pre-commit
new file mode 100755
index 00000000..4c618746
--- /dev/null
+++ b/git_hooks/pre-commit
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+TDIR=`mktemp -d -t vimium`
+
+if [ $? -ne 0 ]
+then
+ exit 1
+fi
+
+git checkout-index --prefix=$TDIR/ -af
+
+cake test
+
+TEST_RESULT=$?
+
+rm -rf $TDIR
+
+exit $TEST_RESULT