diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index f504aa80..ff46f32d 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -205,16 +205,13 @@ impl Data { repo: &str, client: &GhApiClient, ) -> Result { - let mut repo = Url::parse(repo)?; - let mut repository_host = RepositoryHost::guess_git_hosting_services(&repo); - - if repository_host == RepositoryHost::Unknown { - repo = client - .remote_client() - .get_redirected_final_url(repo) - .await?; - repository_host = RepositoryHost::guess_git_hosting_services(&repo); - } + let repo = Url::parse(repo)?; + let mut repo = client + .remote_client() + .get_redirected_final_url(repo.clone()) + .await + .unwrap_or(repo); + let repository_host = RepositoryHost::guess_git_hosting_services(&repo); let subcrate = RepoInfo::detect_subcrate(&mut repo, repository_host);