From 193e049d6e4c841faf800e302551d2e0a48eee88 Mon Sep 17 00:00:00 2001 From: Michael Hueschen Date: Mon, 29 Nov 2021 13:31:51 -0700 Subject: [PATCH] tomlDependencies: pass allRefs=true when fetching a `rev` this allows us to avoid issues when the default branch is not named `master`. I believe this should fix the issues described in: https://github.com/nix-community/naersk/issues/149 https://github.com/nix-community/naersk/pull/140 using this change seems to fix this error I was seeing: ``` fetching Git repository 'https://github.com/sacredcapital/rep_lang.git'fatal: couldn't find remote ref refs/heads/master error: program 'git' failed with exit code 128 ``` and enables a successful build. I reproduced the successful build on multiple machines. however I cannot be full certain that it works in all cases. additionally, it seems possible that `allRefs = true` causes annoying extra fetching which might be noticeable for repos with many refs... --- lib.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib.nix b/lib.nix index 68ae3b1..a83c314 100644 --- a/lib.nix +++ b/lib.nix @@ -148,6 +148,7 @@ rec url = val.git; } // lib.optionalAttrs (val ? rev) { rev = val.rev; + allRefs = true; } // lib.optionalAttrs (val ? branch) { ref = val.branch; } // lib.optionalAttrs (val ? tag) {