diff --git a/lib/util/git.js b/lib/util/git.js index b854208..e3f52d9 100644 --- a/lib/util/git.js +++ b/lib/util/git.js @@ -70,16 +70,16 @@ try { module.exports.clone = fullClone function fullClone (repo, committish, target, opts) { opts = optCheck(opts) - const gitArgs = ['clone', '-q', repo, target] + const gitArgs = ['clone', '--mirror', '-q', repo, path.join(target, '.git')] if (process.platform === 'win32') { gitArgs.push('--config', 'core.longpaths=true') } return execGit(gitArgs, { cwd: path.dirname(target) - }, opts).then(() => { - return committish && execGit(['checkout', committish], { - cwd: target - }) + }).then(() => { + return execGit(['init'], {cwd: target}) + }).then(() => { + return committish && execGit(['checkout', committish], {cwd: target}) }).then(() => { return updateSubmodules(target, opts) }).then(() => headSha(target, opts))