From a7b0011f6c1cc8dfd560cdd0a8404e2e627d7a77 Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Thu, 8 Apr 2021 16:49:09 -0400 Subject: [PATCH] test: fix git init call extra opts --- test/tap/git-npmignore.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/tap/git-npmignore.js b/test/tap/git-npmignore.js index c01f7aa50acc1..ba022b69892d6 100644 --- a/test/tap/git-npmignore.js +++ b/test/tap/git-npmignore.js @@ -7,6 +7,7 @@ var rimraf = require('rimraf') var test = require('tap').test var which = require('which') +var GITHUB_ACTIONS = process.env.GITHUB_ACTIONS var common = require('../common-tap.js') var escapeArg = require('../../lib/utils/escape-arg.js') var Tacks = require('tacks') @@ -151,8 +152,9 @@ function setup (cb) { if (er) return cb(er) var git = escapeArg(gitPath) + var extraOpts = GITHUB_ACTIONS ? ' --initial-branch=main' : '' - exec(git + ' init --initial-branch=main', {cwd: dep}, init) + exec(git + ' init' + extraOpts, {cwd: dep}, init) function init (er, _, stderr) { if (er) return cb(er)