1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 08:12:40 +01:00

Use binary safe diff in arc diff

Summary: Otherwise svn diff fails when the file is binary but the "svn:mime-type = application/x-shellscript" is missing in it.

Test Plan: arc diff succeeded against deleting a binary file which doesn't have svn:mime-type = application/x-shellscript.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2915
This commit is contained in:
Jason Ge 2012-07-03 13:25:49 -07:00
parent 088091ca40
commit f9415e37d0
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,6 @@
#!/bin/sh
diff "$@"
if [ "$?" = "2" ]; then
exit 1
fi

View file

@ -268,9 +268,12 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI {
// itself (such as property changes) and also give us changes to any // itself (such as property changes) and also give us changes to any
// files within the directory (basically, implicit recursion). We don't // files within the directory (basically, implicit recursion). We don't
// want that, so prevent recursive diffing. // want that, so prevent recursive diffing.
$root = phutil_get_library_root('arcanist');
return new ExecFuture( return new ExecFuture(
'(cd %s; svn diff --depth empty --diff-cmd diff -x -U%d %s)', '(cd %s; svn diff --depth empty --diff-cmd %s -x -U%d %s)',
$this->getPath(), $this->getPath(),
$root.'/../scripts/repository/binary_safe_diff.sh',
$this->getDiffLinesOfContext(), $this->getDiffLinesOfContext(),
$path); $path);
} }