aboutsummaryrefslogtreecommitdiff
path: root/bdep/init.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bdep/init.cxx')
-rw-r--r--bdep/init.cxx14
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,