Skip to content

Commit

Permalink
Detect git when in use git worktree
Browse files Browse the repository at this point in the history
  • Loading branch information
alber70g authored Nov 1, 2021
1 parent f11faa9 commit d088337
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/scms/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ 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 d088337

Please sign in to comment.