diff options
-rw-r--r-- | bpkg/manifest-utility.cxx | 4 | ||||
-rw-r--r-- | bpkg/package.hxx | 6 | ||||
-rw-r--r-- | bpkg/rep-remove.cxx | 4 | ||||
-rw-r--r-- | tests/rep-add.test | 2 |
4 files changed, 5 insertions, 11 deletions
diff --git a/bpkg/manifest-utility.cxx b/bpkg/manifest-utility.cxx index fcda389..484ba32 100644 --- a/bpkg/manifest-utility.cxx +++ b/bpkg/manifest-utility.cxx @@ -93,10 +93,6 @@ namespace bpkg try { repository_url u (s); - - if (u.empty ()) - fail << "empty repository location"; - assert (u.path); // Make the relative path absolute using the current directory. diff --git a/bpkg/package.hxx b/bpkg/package.hxx index 6b19203..ea48045 100644 --- a/bpkg/package.hxx +++ b/bpkg/package.hxx @@ -231,9 +231,9 @@ namespace bpkg repository_type type; }; - #pragma db map type(repository_url) as(string) \ - to((?).string ()) \ - from(bpkg::repository_url (?)) + #pragma db map type(repository_url) as(string) \ + to((?).string ()) \ + from((?).empty () ? bpkg::repository_url () : bpkg::repository_url (?)) #pragma db map type(repository_type) as(string) \ to(to_string (?)) \ diff --git a/bpkg/rep-remove.cxx b/bpkg/rep-remove.cxx index 192fe47..c070418 100644 --- a/bpkg/rep-remove.cxx +++ b/bpkg/rep-remove.cxx @@ -433,9 +433,7 @@ namespace bpkg try { repository_url u (a); - - if (u.empty ()) - fail << "empty repository location"; + assert (!u.empty ()); for (const lazy_shared_ptr<repository>& rp: ua) { diff --git a/tests/rep-add.test b/tests/rep-add.test index f53724c..8c4b9f9 100644 --- a/tests/rep-add.test +++ b/tests/rep-add.test @@ -24,7 +24,7 @@ rep_list += -d cfg $clone_cfg; $* '' 2>>EOE != 0 - error: empty repository location + error: invalid repository location '': empty URL EOE } |