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:
David Reuss
2011-10-28 08:04:57 -07:00
committed by epriestley
parent c20608f066
commit 4e900c096f
5 changed files with 39 additions and 0 deletions

View File

@@ -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);