(dir: string, opts?: { commit?: boolean; remote?: string })
| 25 | } |
| 26 | |
| 27 | async function initRepo(dir: string, opts?: { commit?: boolean; remote?: string }) { |
| 28 | await $`git init`.cwd(dir).quiet() |
| 29 | await $`git config core.fsmonitor false`.cwd(dir).quiet() |
| 30 | await $`git config commit.gpgsign false`.cwd(dir).quiet() |
| 31 | await $`git config user.email test@opencode.test`.cwd(dir).quiet() |
| 32 | await $`git config user.name Test`.cwd(dir).quiet() |
| 33 | if (opts?.commit) await $`git commit --allow-empty -m root`.cwd(dir).quiet() |
| 34 | if (opts?.remote) await $`git remote add origin ${opts.remote}`.cwd(dir).quiet() |
| 35 | } |
| 36 | |
| 37 | async function rootCommit(dir: string) { |
| 38 | return (await $`git rev-list --max-parents=0 HEAD`.cwd(dir).text()).trim() |
no test coverage detected