Merge pull request #184 from yihuang/fix-invalid-ref

fix "invalid Git revision 'master'"
This commit is contained in:
adisbladis 2020-10-06 14:49:23 +02:00 committed by GitHub
commit 7fae9be3ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -23,6 +23,11 @@ parser_lock.add_argument(
def fetch_git(pkg):
try:
reference = pkg["source"]["resolved_reference"]
except KeyError:
reference = pkg["source"]["reference"]
return (
pkg["name"],
subprocess.run(
@ -32,7 +37,7 @@ def fetch_git(pkg):
"--url",
pkg["source"]["url"],
"--rev",
pkg["source"]["reference"],
reference,
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,

View file

@ -157,7 +157,7 @@ pythonPackages.callPackage
(
builtins.fetchGit {
inherit (source) url;
rev = source.reference;
rev = source.resolved_reference or source.reference;
ref = sourceSpec.branch or sourceSpec.rev or sourceSpec.tag or "HEAD";
}
) else if isLocal then (poetryLib.cleanPythonSources { src = localDepPath; }) else