Convert "falsey" binary hunks if we have a repository encoding
Summary: This adds an encoding detail to the repository, so we can attempt to convert hunks previously detected as binary. We also add the encoding information to the arcanist projectinfo API so we can pull the information if we have it when uploading changes via arc. Test Plan: Changed encoding through the edit UI, and saw "This is binary file", and changed it back and saw the correct output from the diff. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: 1009
This commit is contained in:
@@ -76,6 +76,12 @@ final class DiffusionGitDiffQuery extends DiffusionDiffQuery {
|
||||
}
|
||||
|
||||
$parser = new ArcanistDiffParser();
|
||||
|
||||
$try_encoding = $repository->getDetail('encoding');
|
||||
if ($try_encoding) {
|
||||
$parser->setTryEncoding($try_encoding);
|
||||
}
|
||||
|
||||
$parser->setDetectBinaryFiles(true);
|
||||
$changes = $parser->parseDiff($raw_diff);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user