Skip to content

Commit

Permalink
fix(git-resolver): resolve commits via https
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed May 14, 2022
1 parent 4985aab commit eb7293d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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

0 comments on commit eb7293d

Please sign in to comment.