Skip to content

Commit 2fe0a85

Browse files
committed
Correctly resolve git hooks directory using git rev-parse
1 parent 97a7465 commit 2fe0a85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/knip/src/util/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const hookFileNames = [
1414

1515
const getGitHooksPath = (defaultPath = '.git/hooks') => {
1616
try {
17-
return execSync('git config --get core.hooksPath', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
17+
return execSync('git rev-parse --git-path hooks', { encoding: 'utf8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
1818
} catch (_error) {
1919
return defaultPath;
2020
}

0 commit comments

Comments
 (0)