sync: Do not fail to sync a manifest with no projects

Since commit 454fdaf119 (v2.48), syncing a
manifest without any projects would result in:

  Repo command failed: RepoUnhandledExceptionError
          Number of processes must be at least 1

Bug: 377546300
Change-Id: Iaa2f6a3ac64542ad65a19c0eef449f53c09cae67
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/443442
Reviewed-by: Erik Elmeke <erik@haleytek.corp-partner.google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
This commit is contained in:
Peter Kjellerstedt 2024-11-20 21:10:29 +01:00 committed by LUCI
parent fafd1ec23e
commit 616e314902

View File

@ -901,7 +901,7 @@ later is required to fix a server side protocol bug.
objdir_project_map.setdefault(project.objdir, []).append(index) objdir_project_map.setdefault(project.objdir, []).append(index)
projects_list = list(objdir_project_map.values()) projects_list = list(objdir_project_map.values())
jobs = min(opt.jobs_network, len(projects_list)) jobs = max(1, min(opt.jobs_network, len(projects_list)))
# We pass the ssh proxy settings via the class. This allows # We pass the ssh proxy settings via the class. This allows
# multiprocessing to pickle it up when spawning children. We can't # multiprocessing to pickle it up when spawning children. We can't