summaryrefslogtreecommitdiff
path: root/commit.d/50vcs-commit
diff options
context:
space:
mode:
Diffstat (limited to 'commit.d/50vcs-commit')
-rwxr-xr-xcommit.d/50vcs-commit18
1 files changed, 18 insertions, 0 deletions
diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit
new file mode 100755
index 0000000..48fa177
--- /dev/null
+++ b/commit.d/50vcs-commit
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+
+message="$1"
+
+if [ "$VCS" = git ] && [ -d .git ]; then
+ if [ -n "$message" ]; then
+ git commit $GIT_COMMIT_OPTIONS -m "$message"
+ else
+ git commit $GIT_COMMIT_OPTIONS
+ fi
+elif [ "$VCS" = hg ] && [ -d .hg ]; then
+ if [ -n "$message" ]; then
+ hg commit $HG_COMMIT_OPTIONS -m "$message"
+ else
+ hg commit $HG_COMMIT_OPTIONS
+ fi
+fi