Skip to content

Commit 1abdcd7

Browse files
cexosoxiongjieJounQin
authored
fix: only get local coore.hooksPath config (#130)
Co-authored-by: xiongjie <jiexiong@futunn.com> Co-authored-by: JounQin <admin@1stg.me>
1 parent 2ad5514 commit 1abdcd7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/cold-falcons-pick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"simple-git-hooks": patch
3+
---
4+
5+
fix: only get local `coore.hooksPath` config

simple-git-hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ async function setHooksFromConfig(projectRootPath=process.cwd(), argv=process.ar
197197
function _getHooksDirPath(projectRoot) {
198198
const defaultHooksDirPath = path.join(projectRoot, '.git', 'hooks')
199199
try {
200-
const customHooksDirPath = execSync('git config core.hooksPath', {
200+
const customHooksDirPath = execSync('git config --local core.hooksPath', {
201201
cwd: projectRoot,
202202
encoding: 'utf8'
203203
}).trim()

0 commit comments

Comments
 (0)