From 2eca24bcfbfc1fad6cfa51cd44555e9c2dfc3536 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 2 May 2024 08:09:05 -0700 Subject: [PATCH] fix: use git+https protocol for repo url (#441) --- lib/util/git.js | 2 +- package.json | 2 +- workspace/test-workspace/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/util/git.js b/lib/util/git.js index c28760db..681af788 100644 --- a/lib/util/git.js +++ b/lib/util/git.js @@ -23,7 +23,7 @@ const getRemoteUrl = async (path, remote) => { try { const urlStr = await tryGit(path, 'remote', 'get-url', remote) const { domain, user, project } = hgi.fromUrl(urlStr) - const url = new URL(`https://${domain}`) + const url = new URL(`git+https://${domain}`) url.pathname = `/${user}/${project}.git` return url.toString() } catch { diff --git a/package.json b/package.json index b20dfb4f..4f88b817 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/npm/template-oss.git" + "url": "git+https://github.com/npm/template-oss.git" }, "keywords": [ "npm", diff --git a/workspace/test-workspace/package.json b/workspace/test-workspace/package.json index 4f304a50..cd0d379d 100644 --- a/workspace/test-workspace/package.json +++ b/workspace/test-workspace/package.json @@ -20,7 +20,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/npm/template-oss.git", + "url": "git+https://github.com/npm/template-oss.git", "directory": "workspace/test-workspace" }, "keywords": [],