Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(git-resolver): resolve commits via https #4734

Merged
merged 1 commit into from May 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/violet-kids-clean.md
@@ -0,0 +1,5 @@
---
"@pnpm/git-resolver": patch
---

Resolve commits from GitHub via https.
5 changes: 1 addition & 4 deletions packages/git-resolver/src/parsePref.ts
Expand Up @@ -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
}
Expand Down