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

Function computeHead

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

Source from the content-addressed store, hash-verified

512}
513
514async function computeHead(): Promise<string> {
515 const gitDir = await resolveGitDir()
516 if (!gitDir) {
517 return ''
518 }
519 const head = await readGitHead(gitDir)
520 if (!head) {
521 return ''
522 }
523 if (head.type === 'branch') {
524 return (await resolveRef(gitDir, `refs/heads/${head.name}`)) ?? ''
525 }
526 return head.sha
527}
528
529async function computeRemoteUrl(): Promise<string | null> {
530 const gitDir = await resolveGitDir()

Callers

nothing calls this directly

Calls 3

resolveGitDirFunction · 0.85
readGitHeadFunction · 0.85
resolveRefFunction · 0.85

Tested by

no test coverage detected