MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / computeRemoteUrl

Function computeRemoteUrl

source code/utils/git/gitFilesystem.ts:529–544  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

527}
528
529async function computeRemoteUrl(): Promise<string | null> {
530 const gitDir = await resolveGitDir()
531 if (!gitDir) {
532 return null
533 }
534 const url = await parseGitConfigValue(gitDir, 'remote', 'origin', 'url')
535 if (url) {
536 return url
537 }
538 // In worktrees, the config with remote URLs is in the common dir
539 const commonDir = await getCommonDir(gitDir)
540 if (commonDir && commonDir !== gitDir) {
541 return parseGitConfigValue(commonDir, 'remote', 'origin', 'url')
542 }
543 return null
544}
545
546async function computeDefaultBranch(): Promise<string> {
547 const gitDir = await resolveGitDir()

Callers

nothing calls this directly

Calls 3

resolveGitDirFunction · 0.85
parseGitConfigValueFunction · 0.85
getCommonDirFunction · 0.85

Tested by

no test coverage detected