private $command;
private $stashed;
+ private $shouldAmend;
private $projectInfo;
private $repositoryInfo;
}
if ($must_commit) {
- if ($this->shouldAmend()) {
+ if ($this->getShouldAmend()) {
$commit = head($api->getLocalCommitInformation());
$api->amendCommit($commit['message']);
} else if ($api->supportsLocalCommits()) {
}
}
- private function shouldAmend() {
- return $this->calculateShouldAmend();
+ private function getShouldAmend() {
+ if ($this->shouldAmend === null) {
+ $this->shouldAmend = $this->calculateShouldAmend();
+ }
+ return $this->shouldAmend;
}
private function calculateShouldAmend() {
}
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));