return $this->relativeCommit;
}
- private function getDiffFullOptions($detect_moves_and_renames = true) {
- $options = array(
+ 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',
self::getDiffBaseOptions(),
'--no-color',
'--src-prefix=a/',
);
if ($detect_moves_and_renames) {
- $options[] = '-M';
- $options[] = '-C';
+ $diff_cmd[] = '-M';
+ $diff_cmd[] = '-C';
}
- return implode(' ', $options);
+ return implode(' ', $diff_cmd);
}
private function getDiffBaseOptions() {
}
public function getFullGitDiff() {
- $options = $this->getDiffFullOptions();
+ $diff_cmd = $this->getDiffFullCommand();
list($stdout) = $this->execxLocal(
- "diff {$options} %s --",
+ "{$diff_cmd} %s --",
$this->getRelativeCommit());
return $stdout;
}
* generate real diff text.
*/
public function getRawDiffText($path, $detect_moves_and_renames = true) {
- $options = $this->getDiffFullOptions($detect_moves_and_renames);
+ $diff_cmd = $this->getDiffFullCommand($detect_moves_and_renames);
list($stdout) = $this->execxLocal(
- "diff {$options} %s -- %s",
+ "{$diff_cmd} %s -- %s",
$this->getRelativeCommit(),
$path);
return $stdout;