Skip to content

Commit 5fed3f0

Browse files
author
xiongjie
committed
feat: just get config hooksPath local
git config core.hooksPath will get the global config probably,and will overwrite hooks with setHooksFromConfig function,and this will affect the other project。
1 parent 2ad5514 commit 5fed3f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)