mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 15:16:37 +00:00
fix: use the GhApiClient to normalize GitHub URLs
This commit is contained in:
parent
a39cf031f9
commit
8a0c6b68c0
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue