1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-12-23 05:50:54 +01:00

Make arc patch slightly better about submodules

Summary:
Ref T3776, Ref T479. Say you have some DN, with a submodule X@Y. Later, X@Z in your working copy / repo. If you run arc patch DN, you'd end up with a dirty working copy claiming that X@Z was wrong and it should be X@Y.

To fix, basically run 'submodule init' and 'submodule update'. This makes it so after "arc patch" if you run "git status" it looks clean.

Gross part though now is if you then "git checkout master" you'll have a dirty checkout the other way. I think this is better though.

Test Plan: made a new repository where I added libphutil @ X, did some work (DX), then made libphutil @ y. When I arc patch'd DX, things looked good!

Reviewers: epriestley

Reviewed By: epriestley

CC: csilvers, Korvin, aran

Maniphest Tasks: T479, T3776

Differential Revision: https://secure.phabricator.com/D6837
This commit is contained in:
Bob Trahan 2013-08-28 16:47:30 -07:00
parent 3ad72195bf
commit 96a47759ae

View file

@ -692,6 +692,10 @@ EOTEXT
throw new ArcanistUsageException("Unable to apply patch!");
}
// in case there were any submodule changes involved
$repository_api->execpassthru(
'submodule update --init');
if ($this->shouldCommit()) {
if ($bundle->getFullAuthor()) {
$author_cmd = csprintf('--author=%s', $bundle->getFullAuthor());