Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Whidden <twhid@twhid.com>2015-02-08 04:53:01 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-02-27 11:41:02 +0300
commita2e04bd921feab8f9e40a27e180ca9308eb709d7 (patch)
treeee6d11305866d7f0342488b74a510817cda9bac8
parentf33e8b8ff2de094071c5976be95e35110cf2ab1a (diff)
cache: don't add 'git+' when it's already there
Fixes #7294.
-rw-r--r--lib/cache/add-remote-git.js4
1 files changed, 3 insertions, 1 deletions
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