diff options
| author | Peter Kjellerstedt <pkj@axis.com> | 2021-05-19 19:37:23 +0200 |
|---|---|---|
| committer | Mike Frysinger <vapier@google.com> | 2021-05-20 16:23:10 +0000 |
| commit | d177609cb0283e41e23d4c19b94e17f42bdbdacb (patch) | |
| tree | 524cc1eb2b87d95e11e1816017717e9f99c46743 /subcmds | |
| parent | b16b9d26bd2d05d704da3e38f3eee743f2b110c6 (diff) | |
| download | git-repo-d177609cb0283e41e23d4c19b94e17f42bdbdacb.tar.gz | |
sync: Sync submodules correctly againv2.15.3
Commit b4429439 (sync: refactor main fetch loop) broke syncing of
submodules with sync-s="true". The first `repo sync` would just fetch
the superrepo, while the second `repo sync` would fetch the submodules.
This was due to the new _FetchMain() function not passing back the
all_projects variable that it had modified.
Change-Id: Ie8187cde7bb894e4e9a6b76c2aed83873d9f69a4
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/307065
Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/sync.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index fb25c221..67d9c115 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -469,11 +469,14 @@ later is required to fix a server side protocol bug. | |||
| 469 | Args: | 469 | Args: |
| 470 | opt: Program options returned from optparse. See _Options(). | 470 | opt: Program options returned from optparse. See _Options(). |
| 471 | args: Command line args used to filter out projects. | 471 | args: Command line args used to filter out projects. |
| 472 | all_projects: List of all projects that should be checked out. | 472 | all_projects: List of all projects that should be fetched. |
| 473 | err_event: Whether an error was hit while processing. | 473 | err_event: Whether an error was hit while processing. |
| 474 | manifest_name: Manifest file to be reloaded. | 474 | manifest_name: Manifest file to be reloaded. |
| 475 | load_local_manifests: Whether to load local manifests. | 475 | load_local_manifests: Whether to load local manifests. |
| 476 | ssh_proxy: SSH manager for clients & masters. | 476 | ssh_proxy: SSH manager for clients & masters. |
| 477 | |||
| 478 | Returns: | ||
| 479 | List of all projects that should be checked out. | ||
| 477 | """ | 480 | """ |
| 478 | rp = self.manifest.repoProject | 481 | rp = self.manifest.repoProject |
| 479 | 482 | ||
| @@ -520,6 +523,8 @@ later is required to fix a server side protocol bug. | |||
| 520 | err_event.set() | 523 | err_event.set() |
| 521 | fetched.update(new_fetched) | 524 | fetched.update(new_fetched) |
| 522 | 525 | ||
| 526 | return all_projects | ||
| 527 | |||
| 523 | def _CheckoutOne(self, detach_head, force_sync, project): | 528 | def _CheckoutOne(self, detach_head, force_sync, project): |
| 524 | """Checkout work tree for one project | 529 | """Checkout work tree for one project |
| 525 | 530 | ||
| @@ -1006,8 +1011,9 @@ later is required to fix a server side protocol bug. | |||
| 1006 | with ssh.ProxyManager(manager) as ssh_proxy: | 1011 | with ssh.ProxyManager(manager) as ssh_proxy: |
| 1007 | # Initialize the socket dir once in the parent. | 1012 | # Initialize the socket dir once in the parent. |
| 1008 | ssh_proxy.sock() | 1013 | ssh_proxy.sock() |
| 1009 | self._FetchMain(opt, args, all_projects, err_event, manifest_name, | 1014 | all_projects = self._FetchMain(opt, args, all_projects, err_event, |
| 1010 | load_local_manifests, ssh_proxy) | 1015 | manifest_name, load_local_manifests, |
| 1016 | ssh_proxy) | ||
| 1011 | 1017 | ||
| 1012 | if opt.network_only: | 1018 | if opt.network_only: |
| 1013 | return | 1019 | return |
