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

Commit

Permalink
fix(git): only use longpaths on win32 because old gits
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed May 5, 2017
1 parent 8818f96 commit 32846fc
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions lib/util/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ try {
module.exports.clone = fullClone
function fullClone (repo, committish, target, opts) {
opts = optCheck(opts)
const gitArgs = [
'clone',
'-q',
// Mainly for windows, but no harm done
'-c', 'core.longpaths=true',
repo,
target
]
const gitArgs = ['clone', '-q', repo, target]
if (process.platform === 'win32') {
gitArgs.push('--config', 'core.longpaths=true')
}
return execGit(gitArgs, {
cwd: path.dirname(target)
}, opts).then(() => {
Expand All @@ -72,16 +68,10 @@ function fullClone (repo, committish, target, opts) {
module.exports.shallow = shallowClone
function shallowClone (repo, branch, target, opts) {
opts = optCheck(opts)
const gitArgs = [
'clone',
'--depth=1',
'-q',
'-b', branch,
// Mainly for windows, but no harm done
'-c', 'core.longpaths=true',
repo,
target
]
const gitArgs = ['clone', '--depth=1', '-q', '-b', branch, repo, target]
if (process.platform === 'win32') {
gitArgs.push('--config', 'core.longpaths=true')
}
return execGit(gitArgs, {
cwd: target
}, opts).then(() => {
Expand All @@ -90,13 +80,7 @@ function shallowClone (repo, branch, target, opts) {
}

function updateSubmodules (localRepo, opts) {
const gitArgs = [
'submodule',
'update',
'-q',
'--init',
'--recursive'
]
const gitArgs = ['submodule', 'update', '-q', '--init', '--recursive']
return execGit(gitArgs, {
cwd: localRepo
}, opts)
Expand Down

0 comments on commit 32846fc

Please sign in to comment.