···
2
2
import { repoMapping } from '../db/schema'
3
3
import { useDb } from './db'
4
4
import { RemoteRejectedError, WireError } from './git-wire/errors'
5
5
+
import { fetchAdvertisement } from './git-wire/upload-pack'
5
6
import { installationOctokit } from './github-app'
6
7
import { spliceDelete, splicePush } from './splice'
7
7
-
import { fetchAdvertisement } from './git-wire/upload-pack'
8
8
9
9
export type RefType = 'branch' | 'tag'
10
10
···
14
14
const spliceDeleteMock = vi.fn<(params: Record<string, unknown>) => Promise<{ status: string }>>()
15
15
const octokitAuthMock = vi.fn<(input: { type: 'installation' }) => Promise<{ token: string }>>()
16
16
17
17
+
vi.mock('../../server/utils/git-wire/upload-pack', () => ({
18
18
+
fetchAdvertisement: (repo: string, token: string) => fetchAdvertisementMock(repo, token),
19
19
+
}))
20
20
+
17
21
vi.mock('../../server/utils/splice', () => ({
18
18
-
fetchAdvertisement: (repo: string, token: string) => fetchAdvertisementMock(repo, token),
19
22
splicePush: (params: Record<string, unknown>) => splicePushMock(params),
20
23
spliceDelete: (params: Record<string, unknown>) => spliceDeleteMock(params),
21
24
}))
···
28
28
initBare(name: string): string {
29
29
const repo = path.join(this.dir, name)
30
30
this.git(['init', '-q', '--bare', repo])
31
31
+
this.git(['symbolic-ref', 'HEAD', 'refs/heads/__synchub_placeholder'], repo)
31
32
return repo
32
33
}
33
34