From 572a1a9ec9184d0236a1c6751ed3f4e4256e27c5 Mon Sep 17 00:00:00 2001 From: igorklopov Date: Wed, 17 Aug 2016 16:22:17 +0300 Subject: [PATCH] cloning bare repo to save time on checking out head --- lib/build.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/build.js b/lib/build.js index eec300a..7a6728f 100644 --- a/lib/build.js +++ b/lib/build.js @@ -14,11 +14,9 @@ const nodePath = path.join(buildPath, 'node'); const patchesPath = path.resolve(__dirname, '../patches'); const nodeRepo = 'https://github.com/nodejs/node'; -// TODO try cloning bare repo - async function gitClone () { log.info('Cloning Node.js from GitHub'); - const args = [ 'clone', '--progress', nodeRepo, 'node' ]; + const args = [ 'clone', '--bare', '--progress', nodeRepo, 'node/.git' ]; const promise = spawn('git', args, { cwd: buildPath }); progress(promise.child, thresholds('clone')); await promise; @@ -26,7 +24,7 @@ async function gitClone () { async function gitResetHard (nodeVersion) { log.info(`Resetting to ${nodeVersion}`); - const args = [ 'reset', '--hard', nodeVersion ]; + const args = [ '--work-tree', '.', 'reset', '--hard', nodeVersion ]; await spawn('git', args, { cwd: nodePath }); }