aboutsummaryrefslogtreecommitdiff
path: root/tests/git-pre-commit-common.testscript
diff options
context:
space:
mode:
Diffstat (limited to 'tests/git-pre-commit-common.testscript')
-rw-r--r--tests/git-pre-commit-common.testscript13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/git-pre-commit-common.testscript b/tests/git-pre-commit-common.testscript
new file mode 100644
index 0000000..ae8b9d4
--- /dev/null
+++ b/tests/git-pre-commit-common.testscript
@@ -0,0 +1,13 @@
+# file : tests/git-pre-commit-common.testscript
+# license : MIT; see accompanying LICENSE file
+
+# Set commonly-used variables and configure git to call the hook being tested.
+# Assume that git-common.testscript is already included.
+#
+gc = $gp commit -a --allow-empty-message -m ''
+
+hooks_dir=$~/hooks
++mkdir $hooks_dir
++$gp config core.hooksPath $hooks_dir
+
++ln -s $0 $hooks_dir/pre-commit