Skip to content

Commit a7b0011

Browse files
committed
test: fix git init call extra opts
1 parent 63b5c56 commit a7b0011

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/tap/git-npmignore.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var rimraf = require('rimraf')
77
var test = require('tap').test
88
var which = require('which')
99

10+
var GITHUB_ACTIONS = process.env.GITHUB_ACTIONS
1011
var common = require('../common-tap.js')
1112
var escapeArg = require('../../lib/utils/escape-arg.js')
1213
var Tacks = require('tacks')
@@ -151,8 +152,9 @@ function setup (cb) {
151152
if (er) return cb(er)
152153

153154
var git = escapeArg(gitPath)
155+
var extraOpts = GITHUB_ACTIONS ? ' --initial-branch=main' : ''
154156

155-
exec(git + ' init --initial-branch=main', {cwd: dep}, init)
157+
exec(git + ' init' + extraOpts, {cwd: dep}, init)
156158

157159
function init (er, _, stderr) {
158160
if (er) return cb(er)

0 commit comments

Comments
 (0)