Skip to content

Commit 7fce6c9

Browse files
committed
Fix parseGitRemoteUrl regression
1 parent 4f1d78c commit 7fce6c9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/utils/git.mts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,7 @@ export function parseGitRemoteUrl(remoteUrl: string): RepoInfo | null {
340340
// 1. Handle SSH-style, e.g. git@github.com:owner/repo.git
341341
if (sshMatch) {
342342
result = { owner: sshMatch[1]!, repo: sshMatch[2]! }
343-
}
344-
if (result) {
343+
} else {
345344
// 2. Handle HTTPS/URL-style, e.g. https://github.com/owner/repo.git
346345
try {
347346
const parsed = new URL(remoteUrl)
@@ -357,5 +356,5 @@ export function parseGitRemoteUrl(remoteUrl: string): RepoInfo | null {
357356
} catch {}
358357
}
359358
parsedGitRemoteUrlCache.set(remoteUrl, result)
360-
return { ...result } as RepoInfo | null
359+
return result ? { ...result } : result
361360
}

0 commit comments

Comments
 (0)