MCPcopy
hub / github.com/desktop/desktop / createRepository

Function createRepository

app/test/helpers/repository-builder-pull-test.ts:13–76  ·  view source on GitHub ↗
(
  t: TestContext,
  branchName: string
)

Source from the content-addressed store, hash-verified

11 * @param branchName name to use for new branch
12 */
13export async function createRepository(
14 t: TestContext,
15 branchName: string
16): Promise<Repository> {
17 const repository = await setupEmptyRepository(t)
18
19 // make two commits on `master` to setup the README
20
21 const firstCommit = {
22 commitMessage: 'First!',
23 entries: [
24 {
25 path: 'README.md',
26 contents: '# HELLO WORLD! \n',
27 },
28 ],
29 }
30
31 await makeCommit(repository, firstCommit)
32
33 const secondCommit = {
34 commitMessage: 'Second!',
35 entries: [
36 {
37 path: 'THING.md',
38 contents: '# HELLO WORLD! \nTHINGS GO HERE\n',
39 },
40 {
41 path: 'OTHER.md',
42 contents: '# HELLO WORLD! \nTHINGS GO HERE\n',
43 },
44 ],
45 }
46
47 await makeCommit(repository, secondCommit)
48
49 await switchTo(repository, branchName)
50
51 const firstCommitToBranch = {
52 commitMessage: 'Added a new file',
53 entries: [
54 {
55 path: 'CONTRIBUTING.md',
56 contents: '',
57 },
58 ],
59 }
60
61 await makeCommit(repository, firstCommitToBranch)
62
63 const secondCommitToBranch = {
64 commitMessage: 'Updated README',
65 entries: [
66 {
67 path: 'README.md',
68 contents: 'things go here',
69 },
70 ],

Callers 3

setupFunction · 0.90
setupFunction · 0.90
setupFunction · 0.90

Calls 3

setupEmptyRepositoryFunction · 0.90
makeCommitFunction · 0.90
switchToFunction · 0.90

Tested by

no test coverage detected