summaryrefslogtreecommitdiff
path: root/commit.d/50vcs-commit
blob: 48fa1772f5820d4351c1625aab0f6cc03c8022d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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