From 283703872638c46fd1c4e8a49e3b4103d4268233 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 1 May 2024 22:29:47 -0700 Subject: [PATCH] fix: use git+https protocol for repo url --- 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": [],