aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-09-10 20:10:37 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-09-10 20:10:37 +0300
commit52328fcf012ddcad1d17f54db4966b3ffe4df802 (patch)
treeb2fde8de5cb5960f6927d131183f56de44767cfb
parentfeef51b5d18364fe362c16a0e216c58edf022330 (diff)
Issue warning for git repository that have no packages available and its URL has no fragment
-rw-r--r--bpkg/rep-fetch.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/bpkg/rep-fetch.cxx b/bpkg/rep-fetch.cxx
index abc43fc..77ffc10 100644
--- a/bpkg/rep-fetch.cxx
+++ b/bpkg/rep-fetch.cxx
@@ -373,6 +373,7 @@ namespace bpkg
// fragment list.
//
rep_fetch_data r;
+ size_t np (0);
for (git_fragment& gf: git_fetch (co, rl, td))
{
@@ -420,6 +421,8 @@ namespace bpkg
ignore_unknown,
rl,
fr.friendly_name);
+ np += fr.packages.size ();
+
r.fragments.push_back (move (fr));
}
@@ -435,6 +438,11 @@ namespace bpkg
filesystem_state_changed = true;
}
+ if (np == 0 && !rl.url ().fragment)
+ warn << "repository " << rl << " has no available packages" <<
+ info << "consider specifying explicit URL fragment (for example, "
+ << "#master)";
+
return r;
}