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:
parent
2d63d080df
commit
3f05751724
1 changed files with 6 additions and 3 deletions
|
@ -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')."'";
|
||||
|
|
Loading…
Reference in a new issue