MCPcopy Index your code
hub / github.com/desktop/desktop / getFilesUsingBinaryMergeDriver

Function getFilesUsingBinaryMergeDriver

app/src/lib/git/diff.ts:947–964  ·  view source on GitHub ↗
(
  repository: Repository,
  files: ReadonlyArray<IStatusEntry>
)

Source from the content-addressed store, hash-verified

945const binaryListRegex = /-\t-\t(?:\0.+\0)?([^\0]*)/gi
946
947async function getFilesUsingBinaryMergeDriver(
948 repository: Repository,
949 files: ReadonlyArray<IStatusEntry>
950) {
951 const { stdout } = await git(
952 ['check-attr', '--stdin', '-z', 'merge'],
953 repository.path,
954 'getConflictedFilesUsingBinaryMergeDriver',
955 {
956 stdin: files.map(f => f.path).join('\0'),
957 }
958 )
959
960 return createLogParser({ path: '', attr: '', value: '' })
961 .parse(stdout)
962 .filter(x => x.attr === 'merge' && x.value === 'binary')
963 .map(x => x.path)
964}
965
966// Prefix absolute path with `:(top,literal)` to ensure that git treats it as a
967// literal path. This is important for paths that appear to be absolute paths on

Callers 1

getBinaryPathsFunction · 0.85

Calls 4

gitFunction · 0.90
createLogParserFunction · 0.90
filterMethod · 0.65
parseMethod · 0.65

Tested by

no test coverage detected