mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 06:42:41 +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();
|
$included = array();
|
||||||
if ($included_commits) {
|
if ($included_commits) {
|
||||||
|
@ -1673,9 +1674,11 @@ EOTEXT
|
||||||
$repository_api instanceof ArcanistGitAPI &&
|
$repository_api instanceof ArcanistGitAPI &&
|
||||||
$this->shouldAmend());
|
$this->shouldAmend());
|
||||||
if ($should_amend) {
|
if ($should_amend) {
|
||||||
$repository_api->amendCommit($template);
|
$wrote = (rtrim($old_message) != rtrim($template));
|
||||||
$wrote = true;
|
if ($wrote) {
|
||||||
$where = 'commit message';
|
$repository_api->amendCommit($template);
|
||||||
|
$where = 'commit message';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$wrote = $this->writeScratchFile('create-message', $template);
|
$wrote = $this->writeScratchFile('create-message', $template);
|
||||||
$where = "'".$this->getReadableScratchFilePath('create-message')."'";
|
$where = "'".$this->getReadableScratchFilePath('create-message')."'";
|
||||||
|
|
Loading…
Reference in a new issue