-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
HUSKY_GIT_PARAMS are not correctly provided to a node-process for prepare-commit-message.
OS: Windows 10
Shell: cygwin
Node: 12.16.1
Husky: 4.2.5
"prepare-commit-msg": "node bin/prepare-commit-msg/git-commit-template.js"
bin/prepare-commit-msg/git-commit-template.js
---------------------------------------------
#!/usr/bin/env node
console.dir(process.env.HUSKY_GIT_PARAMS);Output:
$ git commit
husky > prepare-commit-msg (node v12.16.1)
'.git/COMMIT_EDITMSG'
$ git commit (with existing commit.template-setting)
husky > prepare-commit-msg (node v12.16.1)
'.git/COMMIT_EDITMSG'
$ git commit -m "foobar"
husky > prepare-commit-msg (node v12.16.1)
'.git/COMMIT_EDITMSG'
$ git commit --amend
husky > prepare-commit-msg (node v12.16.1)
'.git/COMMIT_EDITMSG'Expected Output:
$ git commit
husky > prepare-commit-msg (node v12.16.1)
'.git/COMMIT_EDITMSG'
$ git commit (with existing commit.template-setting)
husky > prepare-commit-msg (node v12.16.1)
'.git/COMMIT_EDITMSG template'
$ git commit -m "foobar"
husky > prepare-commit-msg (node v12.16.1)
'.git/COMMIT_EDITMSG message'
$ git commit --amend
husky > prepare-commit-msg (node v12.16.1)
'.git/COMMIT_EDITMSG commit HEAD'Am I doing something wrong here?
I think the root-cause is at the .git/hooks/husky.sh - Line 17
"$@" husky-run $hookName "$gitParams"
should be
"$@" husky-run $hookName \"$gitParams\"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels