diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2014-12-25 00:07:30 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2014-12-25 13:11:29 +0300 |
commit | 581a72da18f35ec87edef6255adf4ef4714a478c (patch) | |
tree | a1847fa82178dc161f813fcc0f9d3ae8733c5b1b /lib | |
parent | 5bcba65bed2678ffe80fb596f72abe9871d131c8 (diff) |
map git inflighting to path rather than URL
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache/add-remote-git.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/cache/add-remote-git.js b/lib/cache/add-remote-git.js index acda6d590..ac8e03ca7 100644 --- a/lib/cache/add-remote-git.js +++ b/lib/cache/add-remote-git.js @@ -53,10 +53,6 @@ module.exports = function addRemoteGit (u, silent, cb) { u = u.replace(/^ssh:\/\//, "") } - cb = inflight(u, cb) - if (!cb) return log.verbose("addRemoteGit", u, "already in flight; waiting") - log.verbose("addRemoteGit", u, "not in flight; cloning") - // figure out what we should check out. var co = parsed.hash && parsed.hash.substr(1) || "master" @@ -66,6 +62,9 @@ module.exports = function addRemoteGit (u, silent, cb) { log.verbose("addRemoteGit", [u, co]) var p = path.join(remotes, v) + cb = inflight(p, cb) + if (!cb) return log.verbose("addRemoteGit", p, "already in flight; waiting") + log.verbose("addRemoteGit", p, "not in flight; cloning") getGitDir(function (er) { if (er) return cb(er) @@ -100,7 +99,7 @@ function getGitDir (cb) { function checkGitDir (p, u, co, origUrl, silent, cb) { fs.stat(p, function (er, s) { if (er) return cloneGitRemote(p, u, co, origUrl, silent, cb) - if (!s.isDirectory()) return rm(p, function (er){ + if (!s.isDirectory()) return rm(p, function (er) { if (er) return cb(er) cloneGitRemote(p, u, co, origUrl, silent, cb) }) |