mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +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:
parent
77a9c18140
commit
43792895a6
1 changed files with 8 additions and 4 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue