MCPcopy
hub / github.com/claude-code-best/claude-code / computeHead

Function computeHead

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

Source from the content-addressed store, hash-verified

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