1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

In "arc patch", update submodules slightly later

Summary:
Ref T13151. See PHI648. With `arc patch --nobranch`, we update submodules a little too early.

I //believe// it is safe to just update them a little later, after the intermediate branch management logic runs.

Test Plan: Ran `arc patch --nobranch`, saw submodule update run later. Not 100% sure this doesn't cause weird issues, but I can't anticipate any.

Reviewers: amckinley, jmeador

Reviewed By: jmeador

Maniphest Tasks: T13151

Differential Revision: https://secure.phabricator.com/D19475
This commit is contained in:
epriestley 2018-06-07 09:49:45 -07:00
parent b199ca8086
commit df7313bdf2

View file

@ -714,9 +714,6 @@ EOTEXT
throw new ArcanistUsageException(pht('Unable to apply patch!')); throw new ArcanistUsageException(pht('Unable to apply patch!'));
} }
// in case there were any submodule changes involved
$repository_api->execPassthru('submodule update --init --recursive');
if ($this->shouldCommit()) { if ($this->shouldCommit()) {
if ($bundle->getFullAuthor()) { if ($bundle->getFullAuthor()) {
$author_cmd = csprintf('--author=%s', $bundle->getFullAuthor()); $author_cmd = csprintf('--author=%s', $bundle->getFullAuthor());
@ -754,6 +751,11 @@ EOTEXT
} }
} }
// Synchronize submodule state, since the patch may have made changes
// to ".gitmodules". We do this after we finish managing branches so
// the behavior is correct under "--nobranch"; see PHI648.
$repository_api->execPassthru('submodule update --init --recursive');
echo phutil_console_format( echo phutil_console_format(
"<bg:green>** %s **</bg> %s\n", "<bg:green>** %s **</bg> %s\n",
pht('OKAY'), pht('OKAY'),