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

Function updateRefWith

packages/computer/src/git/plumbing.ts:188–205  ·  view source on GitHub ↗
(opts: UpdateRefWithDeps)

Source from the content-addressed store, hash-verified

186}
187
188export async function updateRefWith(opts: UpdateRefWithDeps): Promise<void> {
189 const dir = opts.dir ?? "/";
190 try {
191 await opts.git.writeRef({
192 fs: opts.fs,
193 dir,
194 ref: opts.ref,
195 value: opts.value,
196 force: opts.force,
197 symbolic: opts.symbolic,
198 });
199 } catch (cause) {
200 if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause });
201 throw new GitError("EUPDATEREFFAIL", `git update-ref failed: ${errorMessage(cause)}`, {
202 cause,
203 });
204 }
205}
206
207// ---------------------------------------------------------------
208// config

Callers 2

updateRefFunction · 0.85
plumbing.test.tsFile · 0.85

Calls 3

isNotARepositoryCauseFunction · 0.85
errorMessageFunction · 0.70
writeRefMethod · 0.65

Tested by

no test coverage detected