1
0
Fork 0
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:
Bob Trahan 2012-11-01 16:47:08 -07:00
parent 5c4d2ae765
commit 027483f29a

View file

@ -1616,8 +1616,13 @@ EOTEXT
$template = ArcanistCommentRemover::removeComments($new_template); $template = ArcanistCommentRemover::removeComments($new_template);
$repository_api = $this->getRepositoryAPI(); $repository_api = $this->getRepositoryAPI();
$should_amend = (count($included_commits) == 1 && $this->shouldAmend()); // special check for whether to amend here. optimizes a common git
if ($should_amend && $repository_api->supportsAmend()) { // 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); $repository_api->amendCommit($template);
$wrote = true; $wrote = true;
$where = 'commit message'; $where = 'commit message';