MCPcopy Create free account
hub / github.com/anthropics/claude-code / gitOf

Function gitOf

mods/diff/tests/git/fetch-hunks.test.ts:39–53  ·  view source on GitHub ↗
(answer: Answer = Fixtures.hunksReadOf)

Source from the content-addressed store, hash-verified

37 })
38
39 function gitOf(answer: Answer = Fixtures.hunksReadOf) {
40 const asks: (readonly string[])[] = []
41 const argvs: (readonly string[])[] = []
42
43 const run: Git.GitRun = argv => {
44 const asked = argv.slice(argv.indexOf('--') + 1)
45
46 argvs.push(argv)
47 asks.push(asked)
48
49 return Promise.resolve(answer(asked, asks.length))
50 }
51
52 return { run, asks, argvs }
53 }
54
55 const linesOf = (body: Git.FileHunks | null | undefined) =>
56 body?.hunks.flatMap(hunk => hunk.lines)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected