Permalink
Browse files

Fix #1272 Support 'host:port' for git+ssh urls

  • Loading branch information...
1 parent 5815abb commit f461ecd215111ec4bfc608d327ddb80439390907 @isaacs isaacs committed Sep 21, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/cache.js
View
@@ -231,6 +231,8 @@ function add (args, cb) {
case "git:":
case "githttp:":
case "githttps:":
+ case "gitrsync:":
+ case "gitftp:":
case "gitssh:":
//p.protocol = p.protocol.replace(/^git([^:])/, "$1")
return addRemoteGit(spec, p, name, cb)
@@ -297,6 +299,7 @@ function addRemoteGit (u, parsed, name, cb_) {
var co = parsed.hash && parsed.hash.substr(1) || "master"
u = u.replace(/^git\+/, "")
.replace(/#.*$/, "")
+ .replace(/^ssh:\/\//, "") // ssh is the default anyway
log.verbose([u, co], "addRemoteGit")
var tmp = path.join(npm.tmp, Date.now()+"-"+Math.random())

0 comments on commit f461ecd

Please sign in to comment.