({ fs, cache, gitdir, oid })
| 4 | import { _readObject as readObject } from '../storage/readObject.js' |
| 5 | |
| 6 | export 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 | } |
no test coverage detected
searching dependent graphs…