git: fallback to FOD fetcher

workaround for https://github.com/NixOS/nix/issues/5128
This commit is contained in:
figsoda 2023-03-15 00:09:12 -04:00
parent bfdf4b80a4
commit 6c9dd650ed
3 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,7 @@ impl<'a> Fetchgit {
) -> Result<String> {
if args.is_empty() && args_str.is_empty() {
git_prefetch(matches!(self.0, GitScheme::Yes), url, rev, !submodules)
.or_else(|_| self.fetch_fod(values, rev, submodules, args, args_str, nixpkgs))
} else {
self.fetch_fod(values, rev, submodules, args, args_str, nixpkgs)
}

View File

@ -57,6 +57,7 @@ impl FetchFromGitea<'_> {
rev,
true,
)
.or_else(|_| self.fetch_fod(values, rev, submodules, args, args_str, nixpkgs))
} else {
url_prefetch(
format!("https://{}/{owner}/{repo}/archive/{rev}.tar.gz", self.0),

View File

@ -292,6 +292,7 @@ pub trait SimpleGitFetcher<'a, const N: usize>: SimpleFetcher<'a, N> {
rev,
!Self::SUBMODULES_DEFAULT,
)
.or_else(|_| self.fetch_fod(values, rev, submodules, args, args_str, nixpkgs))
} else {
flake_prefetch(self.get_flake_ref(values, rev))
}