MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getFileStatus

Function getFileStatus

source code/utils/git.ts:391–419  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 2

loadChangedFilesFunction · 0.85
stashToCleanStateFunction · 0.85

Calls 1

execFileNoThrowFunction · 0.85

Tested by

no test coverage detected