diff --git a/scripts/repository/binary_safe_diff.sh b/scripts/repository/binary_safe_diff.sh new file mode 100755 index 00000000..1473e804 --- /dev/null +++ b/scripts/repository/binary_safe_diff.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +diff "$@" +if [ "$?" = "2" ]; then + exit 1 +fi diff --git a/src/repository/api/ArcanistSubversionAPI.php b/src/repository/api/ArcanistSubversionAPI.php index eb1a2632..6c23727f 100644 --- a/src/repository/api/ArcanistSubversionAPI.php +++ b/src/repository/api/ArcanistSubversionAPI.php @@ -268,9 +268,12 @@ final class ArcanistSubversionAPI extends ArcanistRepositoryAPI { // itself (such as property changes) and also give us changes to any // files within the directory (basically, implicit recursion). We don't // want that, so prevent recursive diffing. + $root = phutil_get_library_root('arcanist'); + 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(), + $root.'/../scripts/repository/binary_safe_diff.sh', $this->getDiffLinesOfContext(), $path); }