| 335 | } |
| 336 | |
| 337 | function 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 | |
| 355 | function isGitNetworkCommand(argv: string[] | undefined) { |
| 356 | const networkCommands = new Set(["clone", "fetch", "pull", "push", "ls-remote", "submodule"]); |