From a2e04bd921feab8f9e40a27e180ca9308eb709d7 Mon Sep 17 00:00:00 2001 From: Tim Whidden Date: Sat, 7 Feb 2015 20:53:01 -0500 Subject: cache: don't add 'git+' when it's already there Fixes #7294. --- lib/cache/add-remote-git.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cache/add-remote-git.js b/lib/cache/add-remote-git.js index c829a4fe6..fecf9c637 100644 --- a/lib/cache/add-remote-git.js +++ b/lib/cache/add-remote-git.js @@ -188,7 +188,9 @@ function resolveHead (p, u, co, origUrl, cb) { parsed.hash = stdout var resolved = url.format(parsed) - if (parsed.protocol !== "git:") resolved = "git+" + resolved + if (!/git(\+|:)/.test(parsed.protocol)) { + resolved = "git+" + resolved + } // https://github.com/npm/npm/issues/3224 // node incorrectly sticks a / at the start of the path We know that the -- cgit v1.2.3