From a225e632da0474a103311c20f20ffa693afec704 Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 8 Nov 2019 15:31:22 -0800 Subject: [PATCH] test: fix git configs for git 2.23 and above Config values are now case-sensitive, so `commit.gpgsign=false` was doing nothing. PR-URL: https://github.com/npm/cli/pull/456 Credit: @isaacs Close: #456 Reviewed-by: @claudiahdz --- lib/install/inflate-shrinkwrap.js | 1 + test/common-tap.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/install/inflate-shrinkwrap.js b/lib/install/inflate-shrinkwrap.js index 1ec4f9ba6dcfd..83e663e203c8c 100644 --- a/lib/install/inflate-shrinkwrap.js +++ b/lib/install/inflate-shrinkwrap.js @@ -84,6 +84,7 @@ function tarballToVersion (name, tb) { } else { matchRegTarball = new RegExp(`^${registry}(.*)?/-/\\1-(.*)[.]tgz$`) } + if (!tb) return const match = tb.match(matchRegTarball) if (!match) return return match[2] || match[1] diff --git a/test/common-tap.js b/test/common-tap.js index 86a90571216cf..9e38c7690fa71 100644 --- a/test/common-tap.js +++ b/test/common-tap.js @@ -193,7 +193,8 @@ exports.makeGitRepo = function (params, cb) { git.chainableExec(['config', 'user.name', user], opts), git.chainableExec(['config', 'user.email', email], opts), // don't time out tests waiting for a gpg passphrase or 2fa - git.chainableExec(['config', 'commit.gpgsign', 'false'], opts), + git.chainableExec(['config', 'commit.gpgSign', 'false'], opts), + git.chainableExec(['config', 'tag.gpgSign', 'false'], opts), git.chainableExec(['config', 'tag.forceSignAnnotated', 'false'], opts), git.chainableExec(['add'].concat(added), opts), git.chainableExec(['commit', '-m', message], opts)