Skip to content

Commit 8e87c0e

Browse files
authored
chore(git): remove redundant variable match (#4255)
* chore(git): remove redundant variable match * chore: yarn version check --interactive
1 parent 8c2f598 commit 8e87c0e

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.yarn/versions/95d4f806.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
releases:
2+
"@yarnpkg/plugin-git": patch
3+
4+
declined:
5+
- "@yarnpkg/plugin-essentials"
6+
- "@yarnpkg/plugin-github"
7+
- "@yarnpkg/plugin-version"
8+
- "@yarnpkg/plugin-workspace-tools"
9+
- "@yarnpkg/cli"

packages/plugin-git/sources/gitUtils.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,18 +302,16 @@ export async function fetchRoot(initialCwd: PortablePath) {
302302
// it may return long paths even when the cwd uses short paths, and we have no
303303
// way to detect it from Node (not even realpath).
304304

305-
let match: PortablePath | null = null;
306-
307305
let cwd: PortablePath;
308306
let nextCwd = initialCwd;
309307
do {
310308
cwd = nextCwd;
311309
if (await xfs.existsPromise(ppath.join(cwd, `.git` as Filename)))
312-
match = cwd;
310+
return cwd;
313311
nextCwd = ppath.dirname(cwd);
314-
} while (match === null && nextCwd !== cwd);
312+
} while (nextCwd !== cwd);
315313

316-
return match;
314+
return null;
317315
}
318316

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

0 commit comments

Comments
 (0)