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

Function init

packages/computer/src/git/worktree.test.ts:27–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25const resetClient = git as unknown as IsomorphicGitResetClient;
26
27async function init() {
28 await memfs.promises.mkdir(DIR, { recursive: true });
29 await git.init({ fs: memfs, dir: DIR, defaultBranch: "main" });
30 // stash creates a commit internally, so it needs an identity.
31 await git.setConfig({ fs: memfs, dir: DIR, path: "user.name", value: AUTHOR.name });
32 await git.setConfig({ fs: memfs, dir: DIR, path: "user.email", value: AUTHOR.email });
33}
34
35async function commit(name: string, content: string, message: string): Promise<string> {
36 await memfs.promises.writeFile(`${DIR}/${name}`, content);

Callers 1

worktree.test.tsFile · 0.70

Calls 3

setConfigMethod · 0.80
mkdirMethod · 0.65
initMethod · 0.65

Tested by

no test coverage detected