diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-11-16 10:31:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-11-16 10:43:30 +0200 |
commit | ab2eb3625208211d6523402d38a54dc60d489119 (patch) | |
tree | 606d19fa5f6f3e22fadcd341c09da4a3368355c8 /bdep/init.cxx | |
parent | 999c3b70fc3b970727042ff0e4def04b2aa41652 (diff) |
Force full refetch on first bdep-init for project (GH issue #343)
Diffstat (limited to 'bdep/init.cxx')
-rw-r--r-- | bdep/init.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
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, |