MCPcopy Index your code
hub / github.com/codeaashu/claude-code / computeRemoteUrl

Function computeRemoteUrl

src/utils/git/gitFilesystem.ts:527–542  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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