commit-msg: Don’t change the current directory for non-Vagrant.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-05-23 11:51:36 -07:00 committed by Anders Kaseorg
parent 9427fb7230
commit 8a128ba81e
1 changed files with 2 additions and 3 deletions

View File

@ -7,12 +7,11 @@
# Do not invoke gitlint if commit message is empty # Do not invoke gitlint if commit message is empty
if grep -q '^[^#]' "$1"; then if grep -q '^[^#]' "$1"; then
lint_cmd="cd ~/zulip && gitlint"
if if
if [ -z "$VIRTUAL_ENV" ] && command -v vagrant >/dev/null && [ -e .vagrant ]; then if [ -z "$VIRTUAL_ENV" ] && command -v vagrant >/dev/null && [ -e .vagrant ]; then
! vagrant ssh -c "$lint_cmd" ! vagrant ssh -c 'cd ~/zulip && gitlint'
else else
! eval "$lint_cmd" ! gitlint
fi <"$1" fi <"$1"
then then
echo "WARNING: Your commit message does not match Zulip's style guide." echo "WARNING: Your commit message does not match Zulip's style guide."