summaryrefslogtreecommitdiffstats
path: root/src/repo.rs
diff options
context:
space:
mode:
authorCyborus <cyborus@noreply.codeberg.org>2024-09-05 18:11:30 +0200
committerCyborus <cyborus@noreply.codeberg.org>2024-09-05 18:11:30 +0200
commitf8650ab284ce549fdd52e52e753fe29e753efe80 (patch)
treedaa9fd486441b869969df92880117659b3b2730b /src/repo.rs
parentMerge pull request 'don't accept cannot-be-a-base urls in parsing' (#123) fro... (diff)
parentfix: consistency among host names (diff)
downloadforgejo-cli-f8650ab284ce549fdd52e52e753fe29e753efe80.tar.xz
forgejo-cli-f8650ab284ce549fdd52e52e753fe29e753efe80.zip
Merge pull request 'improve host name consistency' (#124) from host-consistency into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-cli/pulls/124
Diffstat (limited to 'src/repo.rs')
-rw-r--r--src/repo.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/repo.rs b/src/repo.rs
index c8aa924..5221bf3 100644
--- a/src/repo.rs
+++ b/src/repo.rs
@@ -99,7 +99,7 @@ impl RepoInfo {
let url_s = std::str::from_utf8(remote.url_bytes())?;
let url = crate::ssh_url_parse(url_s)?;
- if url.host_str() == host_url.host_str() {
+ if crate::host_with_port(&url) == crate::host_with_port(host_url) {
name = Some(remote_name_s.to_owned());
}
} else {
@@ -124,7 +124,7 @@ impl RepoInfo {
if let Some(url) = remote.url() {
let (url, _) = url_strip_repo_name(crate::ssh_url_parse(url)?)?;
- if url.host_str() == host_url.host_str()
+ if crate::host_with_port(&url) == crate::host_with_port(host_url)
&& url.path() == host_url.path()
{
name = Some(remote_name.to_owned());