Skip to content

Commit e68751e

Browse files
committed
try fixing null git ref
1 parent 3fbef25 commit e68751e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

pipenv/utils/resolver.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from pipenv.patched.pip._vendor.packaging.utils import canonicalize_name
2828
from pipenv.project import Project
2929
from pipenv.utils import console, err
30-
from pipenv.utils.dependencies import normalize_vcs_url
30+
from pipenv.utils.dependencies import determine_vcs_revision_hash, normalize_vcs_url
3131
from pipenv.utils.fileutils import create_tracked_tempdir
3232
from pipenv.utils.requirements import normalize_name
3333

@@ -604,16 +604,12 @@ def clean_skipped_result(
604604
vcs = ireq.link.scheme.split("+", 1)[0]
605605

606606
# Try to get reference from multiple sources
607-
ref = None
608-
if ireq.link.egg_fragment:
609-
ref = ireq.link.egg_fragment
610-
elif entry.get("ref"):
611-
ref = entry["ref"]
612-
elif hasattr(ireq.link, "ref"):
613-
ref = ireq.link.ref
607+
ref = determine_vcs_revision_hash(ireq, vcs, ireq.link)
614608

615609
if ref:
616610
entry["ref"] = ref
611+
elif ireq.link.hash:
612+
entry["ref"] = ireq.link.hash
617613

618614
# Ensure VCS URL is present
619615
if vcs not in entry:

0 commit comments

Comments
 (0)