aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-06-17 13:23:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-06-17 13:23:41 +0200
commit3fcbeec70419b2234d7b7cf78dc5c0194de4a839 (patch)
tree480586bb81f4dda8879c8114e70e95df0fadd5f0
parent0e961a92b3ce8f962a5b6bddd86c5b59feee589d (diff)
Skip fetching in bdep-sync configurations not known in project (GH issue #391)
-rw-r--r--bdep/sync.cxx11
1 files changed, 10 insertions, 1 deletions
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