Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
fix(git): make full clones do a full mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 6, 2018
1 parent 757bee1 commit 85b269b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/util/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,14 @@ 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
})
return execGit(gitArgs, {cwd: target}).then(() => {
return execGit(['init'], {cwd: target})
}).then(() => {
return execGit(['checkout', committish || 'HEAD'], {cwd: target})
}).then(() => {
return updateSubmodules(target, opts)
}).then(() => headSha(target, opts))
Expand Down

0 comments on commit 85b269b

Please sign in to comment.