Changeset View
Changeset View
Standalone View
Standalone View
src/repository/api/ArcanistGitAPI.php
Show First 20 Lines • Show All 458 Lines • ▼ Show 20 Lines | final class ArcanistGitAPI extends ArcanistRepositoryAPI { | ||||
/** | /** | ||||
* @param the base revision | * @param the base revision | ||||
* @param head revision. If this is null, the generated diff will include the | * @param head revision. If this is null, the generated diff will include the | ||||
* working copy | * working copy | ||||
*/ | */ | ||||
public function getFullGitDiff($base, $head = null) { | public function getFullGitDiff($base, $head = null) { | ||||
$options = $this->getDiffFullOptions(); | $options = $this->getDiffFullOptions(); | ||||
$config_options = array(); | |||||
// See T13432. Disable the rare "diff.suppressBlankEmpty" configuration | |||||
// option, which discards the " " (space) change type prefix on unchanged | |||||
// blank lines. At time of writing the parser does not handle these | |||||
// properly, but generating a more-standard diff is generally desirable | |||||
// even if a future parser handles this case more gracefully. | |||||
$config_options[] = '-c'; | |||||
$config_options[] = 'diff.suppressBlankEmpty=false'; | |||||
if ($head !== null) { | if ($head !== null) { | ||||
list($stdout) = $this->execxLocal( | list($stdout) = $this->execxLocal( | ||||
"diff {$options} %s %s --", | "%LR diff {$options} %s %s --", | ||||
$config_options, | |||||
$base, | $base, | ||||
$head); | $head); | ||||
} else { | } else { | ||||
list($stdout) = $this->execxLocal( | list($stdout) = $this->execxLocal( | ||||
"diff {$options} %s --", | "%LR diff {$options} %s --", | ||||
$config_options, | |||||
$base); | $base); | ||||
} | } | ||||
return $stdout; | return $stdout; | ||||
} | } | ||||
/** | /** | ||||
* @param string Path to generate a diff for. | * @param string Path to generate a diff for. | ||||
▲ Show 20 Lines • Show All 1,097 Lines • Show Last 20 Lines |