From 616e314902b0234cee1cce13bed7d9ef44ce0b6c Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Wed, 20 Nov 2024 21:10:29 +0100 Subject: [PATCH] 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 Reviewed-by: Josip Sokcevic Commit-Queue: Peter Kjellerstedt Tested-by: Peter Kjellerstedt --- subcmds/sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. objdir_project_map.setdefault(project.objdir, []).append(index) 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 # multiprocessing to pickle it up when spawning children. We can't