Skip to content

Commit

Permalink
fetchGit: use allRefs only when it is needed
Browse files Browse the repository at this point in the history
If `branch` or `tag` is given in sourceSpec, then `fetchGit` would
work as before, the only problematic setup is `rev` when used with Nix 2.4+
  • Loading branch information
László Vaskó committed Oct 22, 2021
1 parent 563522a commit fc4cdde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mk-poetry-dep.nix
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ pythonPackages.callPackage
builtins.fetchGit ({
inherit (source) url;
rev = source.resolved_reference or source.reference;
ref = sourceSpec.branch or sourceSpec.rev or (if sourceSpec?tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
ref = sourceSpec.branch or (if sourceSpec ? tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
} // (
let
nixVersion = builtins.substring 0 3 builtins.nixVersion;
in
lib.optionalAttrs (lib.versionAtLeast nixVersion "2.4") {
lib.optionalAttrs ((sourceSpec ? rev) && (lib.versionAtLeast nixVersion "2.4")) {
allRefs = true;
}
))
Expand Down

0 comments on commit fc4cdde

Please sign in to comment.