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

Function branchWith

packages/computer/src/git/refs.ts:63–80  ·  view source on GitHub ↗
(opts: BranchWithDeps)

Source from the content-addressed store, hash-verified

61}
62
63export 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
82export interface GitBranchDeleteOptions {
83 dir?: string;

Callers 2

branchFunction · 0.85
refs.test.tsFile · 0.85

Calls 3

isNotARepositoryCauseFunction · 0.85
errorMessageFunction · 0.70
branchMethod · 0.65

Tested by

no test coverage detected