MCPcopy Create free account
hub / github.com/cloudflare/computer / branchDeleteWith

Function branchDeleteWith

packages/computer/src/git/refs.ts:92–102  ·  view source on GitHub ↗
(opts: BranchDeleteWithDeps)

Source from the content-addressed store, hash-verified

90}
91
92export async function branchDeleteWith(opts: BranchDeleteWithDeps): Promise<void> {
93 const dir = opts.dir ?? "/";
94 try {
95 await opts.git.deleteBranch({ fs: opts.fs, dir, ref: opts.name });
96 } catch (cause) {
97 if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause });
98 throw new GitError("EBRANCHFAIL", `git branch -d failed: ${errorMessage(cause)}`, {
99 cause,
100 });
101 }
102}
103
104export interface GitBranchListOptions {
105 dir?: string;

Callers 2

branchDeleteFunction · 0.85
refs.test.tsFile · 0.85

Calls 3

isNotARepositoryCauseFunction · 0.85
deleteBranchMethod · 0.80
errorMessageFunction · 0.70

Tested by

no test coverage detected