Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [10.x, 12.x, 14.x, 16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion lib/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const pickManifest = require('npm-pick-manifest')
const fs = require('fs')
const mkdirp = require('mkdirp')

module.exports = (repo, ref = 'HEAD', target = null, /* istanbul ignore next */ opts = {}) =>
module.exports = (repo, ref = 'HEAD', target = null, opts = {}) =>
revs(repo, opts).then(revs => clone(
repo,
revs,
Expand Down
11 changes: 8 additions & 3 deletions lib/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ module.exports = (gitArgs, opts = {}) => {

if (gitPath instanceof Error) { return Promise.reject(gitPath) }

// undocumented option, mostly only here for tests
const args = opts.allowReplace || gitArgs[0] === '--no-replace-objects'
? gitArgs
: ['--no-replace-objects', ...gitArgs]

const log = opts.log || procLog
let retry = opts.retry
if (retry === null || retry === undefined) {
Expand All @@ -22,11 +27,11 @@ module.exports = (gitArgs, opts = {}) => {
}
return promiseRetry((retry, number) => {
if (number !== 1) {
log.silly('pacote', `Retrying git command: ${
gitArgs.join(' ')} attempt # ${number}`)
log.silly('git', `Retrying git command: ${
args.join(' ')} attempt # ${number}`)
}

return spawn(gitPath, gitArgs, makeOpts(opts))
return spawn(gitPath, args, makeOpts(opts))
.catch(er => {
if (!shouldRetry(er.stderr, number)) {
throw er
Expand Down
Loading