Skip to content

Commit 4f847fc

Browse files
trivikrmerceyz
authored andcommitted
chore(git): remove redundant variable match (#4255)
* chore(git): remove redundant variable match * chore: yarn version check --interactive (cherry picked from commit 8e87c0e)
1 parent 9a2cd67 commit 4f847fc

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
@@ -289,18 +289,16 @@ export async function fetchRoot(initialCwd: PortablePath) {
289289
// it may return long paths even when the cwd uses short paths, and we have no
290290
// way to detect it from Node (not even realpath).
291291

292-
let match: PortablePath | null = null;
293-
294292
let cwd: PortablePath;
295293
let nextCwd = initialCwd;
296294
do {
297295
cwd = nextCwd;
298296
if (await xfs.existsPromise(ppath.join(cwd, `.git` as Filename)))
299-
match = cwd;
297+
return cwd;
300298
nextCwd = ppath.dirname(cwd);
301-
} while (match === null && nextCwd !== cwd);
299+
} while (nextCwd !== cwd);
302300

303-
return match;
301+
return null;
304302
}
305303

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

0 commit comments

Comments
 (0)