]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Make arc patch slightly better about submodules
authorBob Trahan <bob.trahan@gmail.com>
Wed, 28 Aug 2013 23:47:30 +0000 (16:47 -0700)
committerBob Trahan <bob.trahan@gmail.com>
Wed, 28 Aug 2013 23:47:30 +0000 (16:47 -0700)
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

src/workflow/ArcanistPatchWorkflow.php

index a33e141952a29f48df419c6c24a1809f2831e783..51775c11e633decae5a9b28763efab563f54317c 100644 (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());