MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / parseCommitEntries

Function parseCommitEntries

desktop/project-git/project-commits.ts:40–54  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

38}
39
40function parseCommitEntries(output: string) {
41 return output
42 .replace(trailingLineBreakPattern, '')
43 .split(FIELD_SEPARATOR)
44 .reduce<string[][]>((records, field, index) => {
45 const recordIndex = Math.floor(index / COMMIT_FIELD_COUNT)
46 const currentRecord = records[recordIndex] ?? []
47 currentRecord.push(field)
48 records[recordIndex] = currentRecord
49 return records
50 }, [])
51 .filter((fields) => fields.length >= COMMIT_FIELD_COUNT)
52 .map((fields) => parseCommitEntry(fields.slice(0, COMMIT_FIELD_COUNT)))
53 .filter((record): record is ProjectCommitEntry => record !== null)
54}
55
56export async function resolveCommitRevision(
57 projectId: string,

Callers 2

getProjectCommitEntryFunction · 0.85
listProjectCommitsFunction · 0.85

Calls 1

parseCommitEntryFunction · 0.85

Tested by

no test coverage detected