MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / resolveCommit

Function resolveCommit

src/utils/resolveCommit.js:6–17  ·  view source on GitHub ↗
({ fs, cache, gitdir, oid })

Source from the content-addressed store, hash-verified

4import { _readObject as readObject } from '../storage/readObject.js'
5
6export async function resolveCommit({ fs, cache, gitdir, oid }) {
7 const { type, object } = await readObject({ fs, cache, gitdir, oid })
8 // Resolve annotated tag objects to whatever
9 if (type === 'tag') {
10 oid = GitAnnotatedTag.from(object).parse().object
11 return resolveCommit({ fs, cache, gitdir, oid })
12 }
13 if (type !== 'commit') {
14 throw new ObjectTypeError(oid, type, 'commit')
15 }
16 return { commit: GitCommit.from(object), oid }
17}

Callers 1

_readCommitFunction · 0.90

Calls 3

readObjectFunction · 0.85
parseMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…