( t: TestContext )
| 12 | } from '../../../helpers/repository-scaffolding' |
| 13 | |
| 14 | async function setupRepositoryWithSubmodule( |
| 15 | t: TestContext |
| 16 | ): Promise<{ parent: Repository; submodule: Repository }> { |
| 17 | const parent = await setupEmptyRepository(t) |
| 18 | const submodule = await setupEmptyRepository(t) |
| 19 | |
| 20 | // Add commits to submodule |
| 21 | await makeCommit(submodule, { |
| 22 | commitMessage: 'Initial commit in submodule', |
| 23 | entries: [{ path: 'submodule-file.txt', contents: 'hello from submodule' }], |
| 24 | }) |
| 25 | |
| 26 | await makeCommit(submodule, { |
| 27 | commitMessage: 'Second commit in submodule', |
| 28 | entries: [{ path: 'submodule-file.txt', contents: 'updated content' }], |
| 29 | }) |
| 30 | |
| 31 | // Add commits to parent |
| 32 | await makeCommit(parent, { |
| 33 | commitMessage: 'Initial commit in parent', |
| 34 | entries: [{ path: 'README.md', contents: '# Parent repo' }], |
| 35 | }) |
| 36 | |
| 37 | // Add submodule to parent |
| 38 | await exec( |
| 39 | [ |
| 40 | '-c', |
| 41 | 'protocol.file.allow=always', |
| 42 | 'submodule', |
| 43 | 'add', |
| 44 | submodule.path, |
| 45 | 'test-submodule', |
| 46 | ], |
| 47 | parent.path |
| 48 | ) |
| 49 | |
| 50 | await exec(['commit', '-m', 'Add submodule'], parent.path) |
| 51 | |
| 52 | return { parent, submodule } |
| 53 | } |
| 54 | |
| 55 | describe('git/pull', () => { |
| 56 | describe('with submodules', () => { |
no test coverage detected