Pass parameters to prepare-commit-msg hook

This commit is contained in:
Talia 2022-05-27 10:50:02 +02:00
parent 357a404895
commit de77f6c33c

View file

@ -1,11 +1,13 @@
#!/bin/sh #!/bin/sh
hook=$(basename $0) hook=$(basename $0)
if [ -z "$GIT_DIR" ] if [ -z "$GIT_DIR" ]
then then
GIT_DIR=$(git rev-parse --show-toplevel)/.git GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi fi
if [ -f $GIT_DIR/hooks/$hook ] if [ -f $GIT_DIR/hooks/$hook ]
then then
echo Running project-level hook: $GIT_DIR/hooks/$hook echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook $GIT_DIR/hooks/$hook $@
fi fi