MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / detectGitRepo

Function detectGitRepo

apps/kimi-code/src/utils/git/git-status.ts:146–156  ·  view source on GitHub ↗
(workDir: string)

Source from the content-addressed store, hash-verified

144}
145
146function detectGitRepo(workDir: string): boolean {
147 try {
148 const result = spawnSync('git', ['-C', workDir, 'rev-parse', '--is-inside-work-tree'], {
149 encoding: 'utf8',
150 timeout: SPAWN_TIMEOUT_MS,
151 });
152 return result.status === 0 && result.stdout.trim() === 'true';
153 } catch {
154 return false;
155 }
156}
157
158function readBranch(workDir: string): string | null {
159 try {

Callers 1

createGitStatusCacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected