Skip to content

Commit bc231a3

Browse files
authoredDec 22, 2021
fix: detect git when in use git worktree (#142)
1 parent 5cb47e6 commit bc231a3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/scms/git.js

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ export const detect = (directory) => {
1717
if (gitDirectory) {
1818
return dirname(gitDirectory);
1919
}
20+
21+
const gitWorktreeFile = findUp.sync('.git', {
22+
cwd: directory,
23+
type: 'file',
24+
});
25+
26+
if (gitWorktreeFile) {
27+
return dirname(gitWorktreeFile);
28+
}
2029
};
2130

2231
const runGit = (directory, args) =>

0 commit comments

Comments
 (0)