From ab2eb3625208211d6523402d38a54dc60d489119 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 16 Nov 2023 10:31:55 +0200 Subject: Force full refetch on first bdep-init for project (GH issue #343) --- bdep/init.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'bdep/init.cxx') diff --git a/bdep/init.cxx b/bdep/init.cxx index 16fc717..435c3cc 100644 --- a/bdep/init.cxx +++ b/bdep/init.cxx @@ -223,6 +223,8 @@ namespace bdep // db.reload (*c); + bool first (c->packages.empty ()); // First init for this project. + for (const package_location& p: pkgs) { if (initialized (p, c)) @@ -260,15 +262,19 @@ namespace bdep // Note: semantically equivalent to the first form of the sync // command. // + // If this is the first initialization of this project, also force + // full repository refetch for good measure (see GH issue #343 for + // details). + // if (sync) cmd_sync (o, prj, c, - false /* implicit */, + false /* implicit */, pkg_args, - true /* fetch */, - true /* yes */, - false /* name_cfg */, + first ? true : false /* fetch (full/shallow) */, + true /* yes */, + false /* name_cfg */, pkgs, so, create_host_config, -- cgit v1.1