diff options
author | Michael Hayes <michael@hayes.io> | 2014-06-06 05:53:08 +0400 |
---|---|---|
committer | Domenic Denicola <domenic@domenicdenicola.com> | 2014-06-25 09:51:45 +0400 |
commit | b4a0641336adb448eef002f9cf543b5e1f47014a (patch) | |
tree | dee4df8ada40db5d22b10dfd539033368a5e90be | |
parent | 6c146fbec083813ad19e8d018edaa6dc11a27b2e (diff) |
removed duplicate function
-rw-r--r-- | lib/cache/add-remote-git.js | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/cache/add-remote-git.js b/lib/cache/add-remote-git.js index 2168d189f..bbe38b0e5 100644 --- a/lib/cache/add-remote-git.js +++ b/lib/cache/add-remote-git.js @@ -113,41 +113,6 @@ function checkGitDir (p, u, co, origUrl, silent, 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 (er) return cb(er) - cloneGitRemote(p, u, co, origUrl, silent, cb) - }) - - var git = npm.config.get("git") - var args = [ "config", "--get", "remote.origin.url" ] - var env = gitEnv() - - // check for git - which(git, function (err) { - if (err) { - err.code = "ENOGIT" - return cb(err) - } - exec(git, args, {cwd: p, env: env}, function (er, stdout, stderr) { - var stdoutTrimmed = (stdout + "\n" + stderr).trim() - if (er || u !== stdout.trim()) { - log.warn( "`git config --get remote.origin.url` returned " - + "wrong result ("+u+")", stdoutTrimmed ) - return rm(p, function (er){ - if (er) return cb(er) - cloneGitRemote(p, u, co, origUrl, silent, cb) - }) - } - log.verbose("git remote.origin.url", stdoutTrimmed) - archiveGitRemote(p, u, co, origUrl, cb) - }) - }) - }) -} - function cloneGitRemote (p, u, co, origUrl, silent, cb) { mkdir(p, function (er) { if (er) return cb(er) |