From 8a0c6b68c0ac35a4c3a259f57a3bc47f0f949cc2 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:30:14 -0700 Subject: [PATCH] fix: use the GhApiClient to normalize GitHub URLs --- crates/binstalk-fetchers/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index f589e5fc..18697977 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -195,7 +195,11 @@ impl Data { let mut repo = Url::parse(repo)?; let mut repository_host = RepositoryHost::guess_git_hosting_services(&repo); - if repository_host == RepositoryHost::Unknown { + // gettting the redirected final url for GitHub URLs removes any trailing .git, + // this is needed for the GitHub API which doesn't consider the .git version the same + if repository_host == RepositoryHost::Unknown + || repository_host == RepositoryHost::GitHub + { repo = client .remote_client() .get_redirected_final_url(repo)