We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 499a998 + 744fb6f commit 4a89119Copy full SHA for 4a89119
simple-git-hooks.js
@@ -61,7 +61,13 @@ function getGitProjectRoot(directory=process.cwd()) {
61
let content = fs.readFileSync(fullPath, { encoding: 'utf-8' })
62
let match = /^gitdir: (.*)\s*$/.exec(content)
63
if (match) {
64
- return path.normalize(match[1])
+ let gitDir = match[1]
65
+ let commonDir = path.join(gitDir, 'commondir');
66
+ if (fs.existsSync(commonDir)) {
67
+ commonDir = fs.readFileSync(commonDir, 'utf8').trim();
68
+ return path.resolve(gitDir, commonDir)
69
+ }
70
+ return path.normalize(gitDir)
71
}
72
73
return path.normalize(fullPath)
0 commit comments