From 87c2303eaa6edfa5309da0a30f5ad291b6d57640 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 6 May 2021 10:16:44 -0700 Subject: [PATCH] @npmcli/git@2.0.9 * fix(clone): Do not allow git replacement objects by default --- node_modules/@npmcli/git/lib/clone.js | 2 +- node_modules/@npmcli/git/lib/spawn.js | 11 ++++++++--- node_modules/@npmcli/git/package.json | 4 ++-- package-lock.json | 12 ++++++------ 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/node_modules/@npmcli/git/lib/clone.js b/node_modules/@npmcli/git/lib/clone.js index 1fea5acc84621..6754fd7606009 100644 --- a/node_modules/@npmcli/git/lib/clone.js +++ b/node_modules/@npmcli/git/lib/clone.js @@ -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, diff --git a/node_modules/@npmcli/git/lib/spawn.js b/node_modules/@npmcli/git/lib/spawn.js index cee3a7baf4078..337164a9a012d 100644 --- a/node_modules/@npmcli/git/lib/spawn.js +++ b/node_modules/@npmcli/git/lib/spawn.js @@ -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) { @@ -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 diff --git a/node_modules/@npmcli/git/package.json b/node_modules/@npmcli/git/package.json index 9b368c31e262d..0fe94686ece20 100644 --- a/node_modules/@npmcli/git/package.json +++ b/node_modules/@npmcli/git/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/git", - "version": "2.0.8", + "version": "2.0.9", "main": "lib/index.js", "files": [ "lib/*.js" @@ -29,7 +29,7 @@ "devDependencies": { "slash": "^3.0.0", "standard": "^16.0.3", - "tap": "^14.11.0" + "tap": "^15.0.6" }, "dependencies": { "@npmcli/promise-spawn": "^1.3.2", diff --git a/package-lock.json b/package-lock.json index 17cd843bbe6af..2ff5ecbcccc0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -784,9 +784,9 @@ } }, "node_modules/@npmcli/git": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.0.8.tgz", - "integrity": "sha512-LPnzyBZ+1p7+JzHVwwKycMF8M3lr1ze3wxGRnxn/QxJtk++Y3prSJQrdBDGCxJyRpFsup6J3lrRBVYBhJVrM8Q==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.0.9.tgz", + "integrity": "sha512-hTMbMryvOqGLwnmMBKs5usbPsJtyEsMsgXwJbmNrsEuQQh1LAIMDU77IoOrwkCg+NgQWl+ySlarJASwM3SutCA==", "inBundle": true, "dependencies": { "@npmcli/promise-spawn": "^1.3.2", @@ -10889,9 +10889,9 @@ } }, "@npmcli/git": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.0.8.tgz", - "integrity": "sha512-LPnzyBZ+1p7+JzHVwwKycMF8M3lr1ze3wxGRnxn/QxJtk++Y3prSJQrdBDGCxJyRpFsup6J3lrRBVYBhJVrM8Q==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-2.0.9.tgz", + "integrity": "sha512-hTMbMryvOqGLwnmMBKs5usbPsJtyEsMsgXwJbmNrsEuQQh1LAIMDU77IoOrwkCg+NgQWl+ySlarJASwM3SutCA==", "requires": { "@npmcli/promise-spawn": "^1.3.2", "lru-cache": "^6.0.0",