cloning bare repo to save time on checking out head

This commit is contained in:
igorklopov 2016-08-17 16:22:17 +03:00
parent b393d0da67
commit 572a1a9ec9

View File

@ -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 });
}