MCPcopy Index your code
hub / github.com/desktop/desktop / setupRepositoryWithSubmodule

Function setupRepositoryWithSubmodule

app/test/unit/git/pull/pull-test.ts:14–53  ·  view source on GitHub ↗
(
  t: TestContext
)

Source from the content-addressed store, hash-verified

12} from '../../../helpers/repository-scaffolding'
13
14async 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
55describe('git/pull', () => {
56 describe('with submodules', () => {

Callers 1

pull-test.tsFile · 0.85

Calls 3

setupEmptyRepositoryFunction · 0.90
makeCommitFunction · 0.90
execFunction · 0.85

Tested by

no test coverage detected