Changeset View
Changeset View
Standalone View
Standalone View
src/repository/api/ArcanistGitAPI.php
Show First 20 Lines • Show All 423 Lines • ▼ Show 20 Lines | private function getDiffBaseOptions() { | ||||
return implode(' ', $options); | return implode(' ', $options); | ||||
} | } | ||||
/** | /** | ||||
* @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(); | ||||
$diff_revision = $base; | if ($head !== null) { | ||||
if ($head) { | list($stdout) = $this->execxLocal( | ||||
$diff_revision .= '..'.$head; | "diff {$options} %s %s --", | ||||
} | $base, | ||||
$head); | |||||
} else { | |||||
list($stdout) = $this->execxLocal( | list($stdout) = $this->execxLocal( | ||||
"diff {$options} %s --", | "diff {$options} %s --", | ||||
$diff_revision); | $base); | ||||
} | |||||
return $stdout; | return $stdout; | ||||
} | } | ||||
/** | /** | ||||
* @param string Path to generate a diff for. | * @param string Path to generate a diff for. | ||||
* @param bool If true, detect moves and renames. Otherwise, ignore | * @param bool If true, detect moves and renames. Otherwise, ignore | ||||
* moves/renames; this is useful because it prompts git to | * moves/renames; this is useful because it prompts git to | ||||
* generate real diff text. | * generate real diff text. | ||||
▲ Show 20 Lines • Show All 764 Lines • Show Last 20 Lines |