Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Keep the clone lock-down settings out of the CLI flag registry

garrytan66aa241adc3f
diff --git a/src/core/url-source-origin.ts b/src/core/url-source-origin.ts
index 03b2116ff9..ffa105532f 100644
--- a/src/core/url-source-origin.ts
+++ b/src/core/url-source-origin.ts
@@ -104,7 +104,7 @@ function lockDownCheckout(root: string): void {
const gitDir = hardenedGitSync(root, ['rev-parse', '--absolute-git-dir'], GIT_LIMITS);
if (!gitDir.ok) throw new Error(`Git could not locate the repository of ${root}`);
const file = join(gitDir.stdout.toString('utf8').replace(/\n$/, ''), 'config');
- for (const setting of LFS_OFF_CLONE_CONFIG.filter(arg => arg !== '--config')) {
+ for (const setting of LFS_OFF_CLONE_CONFIG.filter((_, at) => at % 2 === 1)) {
const at = setting.indexOf('=');
execFileSync('git', ['config', '--file', file, setting.slice(0, at), setting.slice(at + 1)],
{ cwd: dirname(file), env: hardenedGitEnvironment(), stdio: 'pipe', timeout: GIT_LIMITS.timeoutMs });