source dump of claude code
at main 18 lines 838 B view raw
1// Git-related behaviors that depend on user settings. 2// 3// This lives outside git.ts because git.ts is in the vscode extension's 4// dep graph and must stay free of settings.ts, which transitively pulls 5// @opentelemetry/api + undici (forbidden in vscode). It's also a cycle: 6// settings.ts → git/gitignore.ts → git.ts, so git.ts → settings.ts loops. 7// 8// If you're tempted to add `import settings` to git.ts — don't. Put it here. 9 10import { isEnvDefinedFalsy, isEnvTruthy } from './envUtils.js' 11import { getInitialSettings } from './settings/settings.js' 12 13export function shouldIncludeGitInstructions(): boolean { 14 const envVal = process.env.CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS 15 if (isEnvTruthy(envVal)) return false 16 if (isEnvDefinedFalsy(envVal)) return true 17 return getInitialSettings().includeGitInstructions ?? true 18}