From a230b0350885194e5f07be667312316ad869b7fc Mon Sep 17 00:00:00 2001 From: lucasenicora <96577991+lucasenicora@users.noreply.github.com> Date: Fri, 24 Dec 2021 10:18:17 +0100 Subject: [PATCH] fix: use cwd option when resolving git repo root (#1075) Co-authored-by: Lucas Nicora --- lib/resolveGitRepo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/resolveGitRepo.js b/lib/resolveGitRepo.js index 7c93a519d..23b03832c 100644 --- a/lib/resolveGitRepo.js +++ b/lib/resolveGitRepo.js @@ -54,7 +54,7 @@ export const resolveGitRepo = async (cwd = process.cwd()) => { // read the path of the current directory relative to the top-level directory // don't read the toplevel directly, it will lead to an posix conform path on non posix systems (cygwin) - const gitRel = normalize(await execGit(['rev-parse', '--show-prefix'])) + const gitRel = normalize(await execGit(['rev-parse', '--show-prefix'], { cwd })) const gitDir = determineGitDir(normalize(cwd), gitRel) const gitConfigDir = normalize(await resolveGitConfigDir(gitDir))