MCPcopy Index your code
hub / github.com/refined-github/refined-github / getFile

Function getFile

source/features/restore-file.tsx:31–44  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

29}
30
31async function getFile(filePath: string): Promise<string | undefined> {
32 const ref = await getMergeBaseReference();
33 const {content, httpStatus} = await api.v3(
34 `contents/${filePath}?ref=${ref}`,
35 {
36 responseFormat: 'base64',
37 ignoreHttpStatus: 404,
38 headers: {
39 accept: 'application/vnd.github.raw',
40 },
41 },
42 );
43 return httpStatus === 404 ? undefined : content;
44}
45
46async function discardChanges(
47 progress: (message: string) => void,

Callers 1

discardChangesFunction · 0.85

Calls 1

getMergeBaseReferenceFunction · 0.85

Tested by

no test coverage detected