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 21, 2021
1 parent b1b3c26 commit 5525d1f
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 (builtins.compareVersions nixVersion "2.4" >= 0) {
lib.optionalAttrs ((sourceSpec ? rev) && (builtins.compareVersions nixVersion "2.4" >= 0)) {
allRefs = true;
}
))
Expand Down

0 comments on commit 5525d1f

Please sign in to comment.