(opts: BranchWithDeps)
| 61 | } |
| 62 | |
| 63 | export async function branchWith(opts: BranchWithDeps): Promise<void> { |
| 64 | const dir = opts.dir ?? "/"; |
| 65 | try { |
| 66 | await opts.git.branch({ |
| 67 | fs: opts.fs, |
| 68 | dir, |
| 69 | ref: opts.name, |
| 70 | object: opts.startPoint, |
| 71 | checkout: opts.checkout, |
| 72 | force: opts.force, |
| 73 | }); |
| 74 | } catch (cause) { |
| 75 | if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause }); |
| 76 | throw new GitError("EBRANCHFAIL", `git branch failed: ${errorMessage(cause)}`, { |
| 77 | cause, |
| 78 | }); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | export interface GitBranchDeleteOptions { |
| 83 | dir?: string; |
no test coverage detected