MCPcopy
hub / github.com/desktop/desktop / getDetectedBinaryFiles

Function getDetectedBinaryFiles

app/src/lib/git/diff.ts:935–943  ·  view source on GitHub ↗

* Runs diff --numstat to get the list of files that have changed and which * Git have detected as binary files

(repository: Repository, ref: string)

Source from the content-addressed store, hash-verified

933 * Git have detected as binary files
934 */
935async function getDetectedBinaryFiles(repository: Repository, ref: string) {
936 const { stdout } = await git(
937 ['diff', '--numstat', '-z', ref],
938 repository.path,
939 'getBinaryPaths'
940 )
941
942 return Array.from(stdout.matchAll(binaryListRegex), m => m[1])
943}
944
945const binaryListRegex = /-\t-\t(?:\0.+\0)?([^\0]*)/gi
946

Callers 1

getBinaryPathsFunction · 0.85

Calls 1

gitFunction · 0.90

Tested by

no test coverage detected