Skip to content

Commit

Permalink
Remove Channel::base_url
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Nov 20, 2023
1 parent 74f1b5b commit f0e721c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion libmamba/include/mamba/core/channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ namespace mamba

[[nodiscard]] auto contains_equivalent(const Channel& other) const -> bool;

[[nodiscard]] auto base_url() const -> std::string;
[[nodiscard]] auto
platform_url(std::string_view platform, bool with_credential = true) const -> std::string;
// The pairs consist of (platform,url)
Expand Down
3 changes: 2 additions & 1 deletion libmamba/src/api/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ namespace mamba
{
auto channels = channel_context.make_chan(pkg_info.url);
assert(channels.size() == 1); // A URL can only resolve to one channel
obj["base_url"] = channels.front().base_url();
obj["base_url"] = channels.front().url().str(specs::CondaURL::Credentials::Remove
);
obj["build_number"] = pkg_info.build_number;
obj["build_string"] = pkg_info.build_string;
obj["channel"] = channels.front().display_name();
Expand Down
5 changes: 0 additions & 5 deletions libmamba/src/core/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ namespace mamba
return url_equivalent_with(other) && util::set_is_superset_of(platforms(), other.platforms());
}

auto Channel::base_url() const -> std::string
{
return url().str(specs::CondaURL::Credentials::Remove);
}

auto Channel::urls(bool with_credential) const -> util::flat_set<std::string>
{
if (!url().package().empty())
Expand Down
2 changes: 1 addition & 1 deletion libmamba/tests/src/core/test_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ namespace mamba
const auto channels1 = channel_context.make_chan("http://localhost:8000/");
REQUIRE_EQ(channels1.size(), 1);
CHECK_EQ(channels1.front().platform_url("win-64", false), "http://localhost:8000/win-64");
CHECK_EQ(channels1.front().base_url(), "http://localhost:8000/");
CHECK_EQ(channels1.front().url().str(), "http://localhost:8000/");
const UrlSet expected_urls({ std::string("http://localhost:8000/") + platform,
"http://localhost:8000/noarch" });
CHECK_EQ(channels1.front().urls(true), expected_urls);
Expand Down

0 comments on commit f0e721c

Please sign in to comment.