Summary: It makes reflog ugly
Test Plan:
# `arc diff`, made error, saw "Message saved to".
# `arc diff`, didn't edit, didn't see "Message saved to".
# `arc diff`, edited, saw "Message saved to".
Reviewers: epriestley
Reviewed By: epriestley
CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4243
));
}
}
+ $old_message = $template;
$included = array();
if ($included_commits) {
$repository_api instanceof ArcanistGitAPI &&
$this->shouldAmend());
if ($should_amend) {
- $repository_api->amendCommit($template);
- $wrote = true;
- $where = 'commit message';
+ $wrote = (rtrim($old_message) != rtrim($template));
+ if ($wrote) {
+ $repository_api->amendCommit($template);
+ $where = 'commit message';
+ }
} else {
$wrote = $this->writeScratchFile('create-message', $template);
$where = "'".$this->getReadableScratchFilePath('create-message')."'";