1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Don't amend commit with the same message in arc diff

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
This commit is contained in:
vrana 2012-12-20 12:11:57 -08:00
parent 2d63d080df
commit 3f05751724

View file

@ -1605,6 +1605,7 @@ EOTEXT
));
}
}
$old_message = $template;
$included = array();
if ($included_commits) {
@ -1673,9 +1674,11 @@ EOTEXT
$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')."'";