MCPcopy
hub / github.com/claude-code-best/claude-code / getFileStatus

Function getFileStatus

src/utils/git.ts:389–417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

387}
388
389export const getFileStatus = async (): Promise<GitFileStatus> => {
390 const { stdout } = await execFileNoThrow(
391 gitExe(),
392 ['--no-optional-locks', 'status', '--porcelain'],
393 {
394 preserveOutputOnError: false,
395 },
396 )
397
398 const tracked: string[] = []
399 const untracked: string[] = []
400
401 stdout
402 .trim()
403 .split('\n')
404 .filter(line => line.length > 0)
405 .forEach(line => {
406 const status = line.substring(0, 2)
407 const filename = line.substring(2).trim()
408
409 if (status === '??') {
410 untracked.push(filename)
411 } else if (filename) {
412 tracked.push(filename)
413 }
414 })
415
416 return { tracked, untracked }
417}
418
419export const getWorktreeCount = async (): Promise<number> => {
420 return getWorktreeCountFromFs()

Callers 2

loadChangedFilesFunction · 0.85
stashToCleanStateFunction · 0.85

Calls 2

execFileNoThrowFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected