Skip to content

Commit

Permalink
test: allow file protocol in git submodule test
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Nov 25, 2022
1 parent 3ea9b7e commit 81ea7fd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/integration/git-submodules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,17 @@ describe('lint-staged', () => {
await execGit(['commit', '-m initial commit'], { cwd: submoduleDir })

// Add the newly-created repo as a submodule in a new path.
// This simulates adding it from a remote
await execGit(['submodule', 'add', '--force', './submodule-temp', './submodule'])
// This simulates adding it from a remote. By default file protocol is not allowed,
// see https://git-scm.com/docs/git-config#Documentation/git-config.txt-protocolallow
await execGit([
'-c',
'protocol.file.allow=always',
'submodule',
'add',
'--force',
'./submodule-temp',
'./submodule',
])
submoduleDir = path.resolve(cwd, 'submodule')
// Set these again for Windows git in CI
await execGit(['config', 'user.name', '"test"'], { cwd: submoduleDir })
Expand Down

0 comments on commit 81ea7fd

Please sign in to comment.