Skip to content

Commit 81ea7fd

Browse files
committed
test: allow file protocol in git submodule test
1 parent 3ea9b7e commit 81ea7fd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/integration/git-submodules.test.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,17 @@ describe('lint-staged', () => {
2929
await execGit(['commit', '-m initial commit'], { cwd: submoduleDir })
3030

3131
// Add the newly-created repo as a submodule in a new path.
32-
// This simulates adding it from a remote
33-
await execGit(['submodule', 'add', '--force', './submodule-temp', './submodule'])
32+
// This simulates adding it from a remote. By default file protocol is not allowed,
33+
// see https://git-scm.com/docs/git-config#Documentation/git-config.txt-protocolallow
34+
await execGit([
35+
'-c',
36+
'protocol.file.allow=always',
37+
'submodule',
38+
'add',
39+
'--force',
40+
'./submodule-temp',
41+
'./submodule',
42+
])
3443
submoduleDir = path.resolve(cwd, 'submodule')
3544
// Set these again for Windows git in CI
3645
await execGit(['config', 'user.name', '"test"'], { cwd: submoduleDir })

0 commit comments

Comments
 (0)