From 3fcbeec70419b2234d7b7cf78dc5c0194de4a839 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 17 Jun 2024 13:23:41 +0200 Subject: Skip fetching in bdep-sync configurations not known in project (GH issue #391) --- bdep/sync.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bdep/sync.cxx b/bdep/sync.cxx index b7e71fb..d92d86a 100644 --- a/bdep/sync.cxx +++ b/bdep/sync.cxx @@ -2777,7 +2777,16 @@ namespace bdep if (fetch) { for (const sync_config& c: ocfgs) - cmd_fetch (o, prj, c, o.fetch_full ()); + { + // Make sure this configuration is known in this project and has + // some of its packages initialized. Failed, that, the project + // repository we are trying to fetch will not be know in this + // configuration and we will fail (see GitHub issue 391 for + // details). + // + if (c != nullptr && !c->packages.empty ()) + cmd_fetch (o, prj, c, o.fetch_full ()); + } } // Increase verbosity for bpkg-fetch command in cmd_sync() if we perform -- cgit v1.1