Reload the correct manifest during sync.

Fix for issue #134
https://code.google.com/p/git-repo/issues/detail?id=134

Change-Id: I94c2dea5dd63917e3f9c90cbd628921d7d61b12a
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 6c903ff..9ed84b9 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -372,6 +372,13 @@
       print('\nerror: Exited sync due to gc errors', file=sys.stderr)
       sys.exit(1)
 
+  def _ReloadManifest(self, manifest_name=None):
+    if manifest_name:
+      # Override calls _Unload already
+      self.manifest.Override(manifest_name)
+    else:
+      self.manifest._Unload()
+
   def UpdateProjectList(self):
     new_project_paths = []
     for project in self.GetProjects(None, missing_ok=True):
@@ -571,7 +578,7 @@
       mp.Sync_LocalHalf(syncbuf)
       if not syncbuf.Finish():
         sys.exit(1)
-      self.manifest._Unload()
+      self._ReloadManifest(opt.manifest_name)
       if opt.jobs is None:
         self.jobs = self.manifest.default.sync_j
     all_projects = self.GetProjects(args,
@@ -596,7 +603,7 @@
       # Iteratively fetch missing and/or nested unregistered submodules
       previously_missing_set = set()
       while True:
-        self.manifest._Unload()
+        self._ReloadManifest(opt.manifest_name)
         all_projects = self.GetProjects(args,
                                         missing_ok=True,
                                         submodules_ok=opt.fetch_submodules)