MCPcopy Create free account
hub / github.com/ReviewStage/stage-cli / fetchContent

Function fetchContent

packages/cli/src/routes/diff.ts:198–205  ·  view source on GitHub ↗
(
	repoRoot: string,
	ref: string | "DISK",
	filePath: string,
)

Source from the content-addressed store, hash-verified

196
197 // Modified binaries emit only `diff --git` + `Binary files ... differ`
198 // (no ---/+++, no rename lines); parse the header itself so images can
199 // still reach the image diff viewer.
200 if (oldPath === null && newPath === null) {
201 const quoted = text.match(DIFF_GIT_QUOTED_RE);
202 if (quoted) {
203 oldPath = decodeQuotedGitPathCapture(quoted[1]);
204 newPath = decodeQuotedGitPathCapture(quoted[2]);
205 } else {
206 const firstLine = text.slice(0, text.indexOf("\n") === -1 ? undefined : text.indexOf("\n"));
207 const halves = splitEqualGitHeader(firstLine);
208 if (halves) {

Callers 1

buildFileContentsFunction · 0.85

Calls 2

readFileContentFunction · 0.85
getGitFileContentFunction · 0.85

Tested by

no test coverage detected