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

Function resolveRef

source code/utils/git/gitFilesystem.ts:205–221  ·  view source on GitHub ↗
(
  gitDir: string,
  ref: string,
)

Source from the content-addressed store, hash-verified

203 * - Peeled: `^<40-hex-sha>\n` (after annotated tag entries)
204 */
205export async function resolveRef(
206 gitDir: string,
207 ref: string,
208): Promise<string | null> {
209 const result = await resolveRefInDir(gitDir, ref)
210 if (result) {
211 return result
212 }
213
214 // For worktrees: try the common gitdir where shared refs live
215 const commonDir = await getCommonDir(gitDir)
216 if (commonDir && commonDir !== gitDir) {
217 return resolveRefInDir(commonDir, ref)
218 }
219
220 return null
221}
222
223async function resolveRefInDir(
224 dir: string,

Callers 7

getOrCreateWorktreeFunction · 0.85
readGitHeadFunction · 0.85
resolveRefInDirFunction · 0.85
computeHeadFunction · 0.85
computeDefaultBranchFunction · 0.85
getHeadForDirFunction · 0.85
readWorktreeHeadShaFunction · 0.85

Calls 2

resolveRefInDirFunction · 0.85
getCommonDirFunction · 0.85

Tested by

no test coverage detected