MCPcopy
hub / github.com/desktop/desktop / getWorkingDirectoryImage

Function getWorkingDirectoryImage

app/src/lib/git/diff.ts:893–904  ·  view source on GitHub ↗
(
  repository: Repository,
  file: FileChange
)

Source from the content-addressed store, hash-verified

891 * https://en.wikipedia.org/wiki/Data_URI_scheme
892 */
893export async function getWorkingDirectoryImage(
894 repository: Repository,
895 file: FileChange
896): Promise<Image> {
897 const contents = await readFile(Path.join(repository.path, file.path))
898 return new Image(
899 contents.buffer,
900 contents.toString('base64'),
901 getMediaType(Path.extname(file.path)),
902 contents.length
903 )
904}
905
906/**
907 * List the modified binary files' paths in the given repository

Callers 2

diff-test.tsFile · 0.90
getImageDiffFunction · 0.85

Calls 2

getMediaTypeFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected