mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-30 04:52:04 -04:00
fix(git-resolver): resolve commits via https (#4734)
This commit is contained in:
5
.changeset/violet-kids-clean.md
Normal file
5
.changeset/violet-kids-clean.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/git-resolver": patch
|
||||
---
|
||||
|
||||
Resolve commits from GitHub via https.
|
||||
@@ -77,10 +77,7 @@ function urlToFetchSpec (urlparse: URL) {
|
||||
async function fromHostedGit (hosted: any): Promise<HostedPackageSpec> { // eslint-disable-line
|
||||
let fetchSpec: string | null = null
|
||||
// try git/https url before fallback to ssh url
|
||||
|
||||
// Note only GitHub has gitTemplate (git://...) in hosted-git-info, has to use
|
||||
// sshTemplate (git@...) for bitbucket and gitlab.
|
||||
const gitUrl = hosted.git({ noCommittish: true }) ?? hosted.ssh({ noCommittish: true })
|
||||
const gitUrl = hosted.https({ noCommittish: true }) ?? hosted.ssh({ noCommittish: true })
|
||||
if (gitUrl && await accessRepository(gitUrl)) {
|
||||
fetchSpec = gitUrl
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user