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

Function assertSafeGitCliArguments

packages/computer/src/runtime/bridge.ts:337–353  ·  view source on GitHub ↗
(argv: string[] | undefined)

Source from the content-addressed store, hash-verified

335}
336
337function assertSafeGitCliArguments(argv: string[] | undefined) {
338 if (
339 argv?.some(
340 (argument) =>
341 argument === "-C" ||
342 argument.startsWith("-C") ||
343 argument === "--git-dir" ||
344 argument.startsWith("--git-dir=") ||
345 argument === "--work-tree" ||
346 argument.startsWith("--work-tree="),
347 )
348 ) {
349 throw new Error(
350 "Git CLI path overrides are not available inside a confined Workspace runtime.",
351 );
352 }
353}
354
355function isGitNetworkCommand(argv: string[] | undefined) {
356 const networkCommands = new Set(["clone", "fetch", "pull", "push", "ls-remote", "submodule"]);

Callers 1

#callGitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected