Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .yarn/versions/95d4f806.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@yarnpkg/plugin-git": patch

declined:
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-github"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/cli"
8 changes: 3 additions & 5 deletions packages/plugin-git/sources/gitUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,16 @@ export async function fetchRoot(initialCwd: PortablePath) {
// it may return long paths even when the cwd uses short paths, and we have no
// way to detect it from Node (not even realpath).

let match: PortablePath | null = null;

let cwd: PortablePath;
let nextCwd = initialCwd;
do {
cwd = nextCwd;
if (await xfs.existsPromise(ppath.join(cwd, `.git` as Filename)))
match = cwd;
return cwd;
nextCwd = ppath.dirname(cwd);
} while (match === null && nextCwd !== cwd);
} while (nextCwd !== cwd);

return match;
return null;
}

export async function fetchBase(root: PortablePath, {baseRefs}: {baseRefs: Array<string>}) {
Expand Down