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
path: root/lib
diff options
context:
space:
mode:
authorChristopher Hiller <chiller@badwing.com>2014-08-03 13:34:16 +0400
committerForrest L Norvell <forrest@npmjs.com>2014-09-21 10:28:59 +0400
commita623da01bea1b2d3f3a18b9117cfd2d8e3cbdd77 (patch)
tree08115f0ea972d4a055e84bb7ccdeaf80fc417848 /lib
parentbfbb1a40b81955d1bc3685cda0e8c609c66a72a4 (diff)
fixes #5867, replaces #5790: no git hooks
Specify dummy template dir when cloning to prevent copying hooks.
Diffstat (limited to 'lib')
-rw-r--r--lib/cache/add-remote-git.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/cache/add-remote-git.js b/lib/cache/add-remote-git.js
index 2b01a378d..89e763130 100644
--- a/lib/cache/add-remote-git.js
+++ b/lib/cache/add-remote-git.js
@@ -70,10 +70,15 @@ module.exports = function addRemoteGit (u, silent, cb_) {
var p = path.join(npm.config.get("cache"), "_git-remotes", v)
- checkGitDir(p, u, co, origUrl, silent, function(er, data) {
- addModeRecursive(p, npm.modes.file, function(erAddMode) {
+ // we don't need global templates when cloning. use this empty dir to specify as template dir
+ mkdir(path.join(npm.config.get("cache"), "_git-remotes", "_templates"), function (er) {
+ if (er) return cb(er)
+ checkGitDir(p, u, co, origUrl, silent, function (er, data) {
if (er) return cb(er, data)
- return cb(erAddMode, data)
+
+ addModeRecursive(p, npm.modes.file, function (er) {
+ return cb(er, data)
+ })
})
})
})
@@ -111,7 +116,8 @@ function cloneGitRemote (p, u, co, origUrl, silent, cb) {
mkdir(p, function (er) {
if (er) return cb(er)
- var args = [ "clone", "--mirror", u, p ]
+ var args = [ "clone", "--template=" + path.join(npm.config.get("cache"),
+ "_git_remotes", "_templates"), "--mirror", u, p ]
var env = gitEnv()
// check for git
@@ -276,4 +282,3 @@ function dirMode(mode) {
if (mode & parseInt( "04", 8)) mode |= parseInt( "01", 8)
return mode
}
-