1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 23:02:41 +01:00

Revert "accommodate git's diff.suppress-blank-empty=true setting (D3963)"

Summary: Reverts D3963, which is obsoleted by D3969.

Test Plan: Straight revert.

Reviewers: vrana, jiiix, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3970
This commit is contained in:
epriestley 2012-11-15 15:47:43 -08:00
parent 2d3d7be09a
commit f4222b3c8b

View file

@ -260,14 +260,8 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
return $this->relativeCommit;
}
private function getDiffFullCommand($detect_moves_and_renames = true) {
$diff_cmd = array(
// Our diff parser relies on the trailing spaces that are suppressed
// when the diff.suppress-blank-empty boolean is set to "true".
// Without the following, "arc lint" would always fail with this:
// "Diff Parse Exception: Found the wrong number of hunk lines."
'-c diff.suppress-blank-empty=false',
'diff',
private function getDiffFullOptions($detect_moves_and_renames = true) {
$options = array(
self::getDiffBaseOptions(),
'--no-color',
'--src-prefix=a/',
@ -276,11 +270,11 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
);
if ($detect_moves_and_renames) {
$diff_cmd[] = '-M';
$diff_cmd[] = '-C';
$options[] = '-M';
$options[] = '-C';
}
return implode(' ', $diff_cmd);
return implode(' ', $options);
}
private function getDiffBaseOptions() {
@ -298,9 +292,9 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
}
public function getFullGitDiff() {
$diff_cmd = $this->getDiffFullCommand();
$options = $this->getDiffFullOptions();
list($stdout) = $this->execxLocal(
"{$diff_cmd} %s --",
"diff {$options} %s --",
$this->getRelativeCommit());
return $stdout;
}
@ -312,9 +306,9 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
* generate real diff text.
*/
public function getRawDiffText($path, $detect_moves_and_renames = true) {
$diff_cmd = $this->getDiffFullCommand($detect_moves_and_renames);
$options = $this->getDiffFullOptions($detect_moves_and_renames);
list($stdout) = $this->execxLocal(
"{$diff_cmd} %s -- %s",
"diff {$options} %s -- %s",
$this->getRelativeCommit(),
$path);
return $stdout;