1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

Arcanist - fix shouldAmend code

Summary: make it a real member variable. See rARC77a9c1814063 and D8753#33914.

Test Plan: sending up this diff!

Reviewers: shadowhand, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8761
This commit is contained in:
Bob Trahan 2014-04-11 13:07:54 -07:00
parent 77a9c18140
commit 43792895a6

View file

@ -62,6 +62,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
private $command;
private $stashed;
private $shouldAmend;
private $projectInfo;
private $repositoryInfo;
@ -913,7 +914,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
}
if ($must_commit) {
if ($this->shouldAmend()) {
if ($this->getShouldAmend()) {
$commit = head($api->getLocalCommitInformation());
$api->amendCommit($commit['message']);
} else if ($api->supportsLocalCommits()) {
@ -926,8 +927,11 @@ abstract class ArcanistBaseWorkflow extends Phobject {
}
}
private function shouldAmend() {
return $this->calculateShouldAmend();
private function getShouldAmend() {
if ($this->shouldAmend === null) {
$this->shouldAmend = $this->calculateShouldAmend();
}
return $this->shouldAmend;
}
private function calculateShouldAmend() {
@ -1000,7 +1004,7 @@ abstract class ArcanistBaseWorkflow extends Phobject {
}
private function getAskForAddPrompt(array $files) {
if ($this->shouldAmend()) {
if ($this->getShouldAmend()) {
$prompt = pht(
'Do you want to amend these files to the commit?',
count($files));