From dfc89ec51c26d6226d767b79fe42e64af55e2b89 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 4 Jun 2024 19:16:00 +0300 Subject: Fix crash in cmd_sync() --- bdep/sync.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bdep/sync.cxx b/bdep/sync.cxx index 25ed63e..b7e71fb 100644 --- a/bdep/sync.cxx +++ b/bdep/sync.cxx @@ -1638,13 +1638,18 @@ namespace bdep // Failed that it will be quite confusing since we may be re-fetching // the same repositories over and over. // - if (cfgs.size () != 1 && *fetch) + // Note: counter-intuitively, we may end up here even if fetch is + // nullopt; see load_implicit() for details. + // + bool deep_fetch (fetch && *fetch); + + if (cfgs.size () != 1 && deep_fetch) text << "fetching in configuration " << p.representation (); run_bpkg (bpkg_fetch_verb, co, "fetch", "-d", p, - (*fetch ? nullptr : "--shallow"), + (deep_fetch ? nullptr : "--shallow"), cfg.reps); } -- cgit v1.1