We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f1d78c commit 7fce6c9Copy full SHA for 7fce6c9
src/utils/git.mts
@@ -340,8 +340,7 @@ export function parseGitRemoteUrl(remoteUrl: string): RepoInfo | null {
340
// 1. Handle SSH-style, e.g. git@github.com:owner/repo.git
341
if (sshMatch) {
342
result = { owner: sshMatch[1]!, repo: sshMatch[2]! }
343
- }
344
- if (result) {
+ } else {
345
// 2. Handle HTTPS/URL-style, e.g. https://github.com/owner/repo.git
346
try {
347
const parsed = new URL(remoteUrl)
@@ -357,5 +356,5 @@ export function parseGitRemoteUrl(remoteUrl: string): RepoInfo | null {
357
356
} catch {}
358
}
359
parsedGitRemoteUrlCache.set(remoteUrl, result)
360
- return { ...result } as RepoInfo | null
+ return result ? { ...result } : result
361
0 commit comments