summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
authorPeter Kjellerstedt <pkj@axis.com>2024-11-20 21:10:29 +0100
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-11-26 10:16:03 +0000
commit616e314902b0234cee1cce13bed7d9ef44ce0b6c (patch)
tree81892392904248a23eac951f91c302e8c1b9c77c /subcmds/sync.py
parentfafd1ec23e8001dc7bdf87f2aa1f59051e33224d (diff)
downloadgit-repo-616e314902b0234cee1cce13bed7d9ef44ce0b6c.tar.gz
sync: Do not fail to sync a manifest with no projects
Since commit 454fdaf1191c87e5c770ab865a911e10e600e178 (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>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 8e4dde6b..17c8b9bf 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -901,7 +901,7 @@ later is required to fix a server side protocol bug.
901 objdir_project_map.setdefault(project.objdir, []).append(index) 901 objdir_project_map.setdefault(project.objdir, []).append(index)
902 projects_list = list(objdir_project_map.values()) 902 projects_list = list(objdir_project_map.values())
903 903
904 jobs = min(opt.jobs_network, len(projects_list)) 904 jobs = max(1, min(opt.jobs_network, len(projects_list)))
905 905
906 # We pass the ssh proxy settings via the class. This allows 906 # We pass the ssh proxy settings via the class. This allows
907 # multiprocessing to pickle it up when spawning children. We can't 907 # multiprocessing to pickle it up when spawning children. We can't