mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +01:00
modify arc diff workflow to only do amend optimization if git repository
Summary: fix for T2011, first option in list of possible fixes Test Plan: ...do I really have to setup mercurial with mq? :D Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2011 Differential Revision: https://secure.phabricator.com/D3869
This commit is contained in:
parent
5c4d2ae765
commit
027483f29a
1 changed files with 7 additions and 2 deletions
|
@ -1616,8 +1616,13 @@ EOTEXT
|
|||
$template = ArcanistCommentRemover::removeComments($new_template);
|
||||
|
||||
$repository_api = $this->getRepositoryAPI();
|
||||
$should_amend = (count($included_commits) == 1 && $this->shouldAmend());
|
||||
if ($should_amend && $repository_api->supportsAmend()) {
|
||||
// special check for whether to amend here. optimizes a common git
|
||||
// workflow. we can't do this for mercurial because the mq extension
|
||||
// is popular and incompatible with hg commit --amend ; see T2011.
|
||||
$should_amend = (count($included_commits) == 1 &&
|
||||
$repository_api instanceof ArcanistGitAPI &&
|
||||
$this->shouldAmend());
|
||||
if ($should_amend) {
|
||||
$repository_api->amendCommit($template);
|
||||
$wrote = true;
|
||||
$where = 'commit message';
|
||||
|
|
Loading…
Reference in a new issue