From 4d2b16e04d9be23e8258867dfbd91405267c9992 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sat, 3 Jul 2021 17:54:29 +0200 Subject: [PATCH] includehandler: Avoid duplicate cloning of repos in command line includes If command line includes refer to the same repo, missing_repos was aggregating those multiple times, causing multiple clone procedures to be triggered. This generally failed. Therefore, build missing_repos while checking for duplicates. Signed-off-by: Jan Kiszka --- kas/includehandler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kas/includehandler.py b/kas/includehandler.py index 6fd3deb..4a1b549 100644 --- a/kas/includehandler.py +++ b/kas/includehandler.py @@ -259,7 +259,9 @@ class IncludeHandler: for configfile in self.top_files: cfgs, reps = _internal_include_handler(configfile) configs.extend(cfgs) - missing_repos.extend(reps) + for repo in reps: + if repo not in missing_repos: + missing_repos.append(repo) config = functools.reduce(_internal_dict_merge, map(lambda x: x[1], configs))