MCPcopy Create free account
hub / github.com/anomalyco/opencode / fileFromDiffPath

Function fileFromDiffPath

packages/opencode/src/project/vcs.ts:57–62  ·  view source on GitHub ↗
(value: string | undefined)

Source from the content-addressed store, hash-verified

55}
56
57const fileFromDiffPath = (value: string | undefined) => {
58 if (!value || value === "/dev/null") return
59 const file = parsePathToken(value)
60 if (file.startsWith("a/") || file.startsWith("b/")) return file.slice(2)
61 return file
62}
63
64const fileFromGitHeader = (header: string) => {
65 if (header.startsWith('"')) {

Callers 2

fileFromGitHeaderFunction · 0.85
fileFromPatchChunkFunction · 0.85

Calls 1

parsePathTokenFunction · 0.85

Tested by

no test coverage detected