Skip to content

Commit

Permalink
fix: detect git when in use git worktree (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
alber70g committed Dec 22, 2021
1 parent 5cb47e6 commit bc231a3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/scms/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ export const detect = (directory) => {
if (gitDirectory) {
return dirname(gitDirectory);
}

const gitWorktreeFile = findUp.sync('.git', {
cwd: directory,
type: 'file',
});

if (gitWorktreeFile) {
return dirname(gitWorktreeFile);
}
};

const runGit = (directory, args) =>
Expand Down

0 comments on commit bc231a3

Please sign in to comment.