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

Function isFileDeleted

source code/utils/commitAttribution.ts:795–814  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

793 * Check if a file was deleted in the staged changes.
794 */
795export async function isFileDeleted(filePath: string): Promise<boolean> {
796 const cwd = getAttributionRepoRoot()
797
798 try {
799 const result = await execFileNoThrowWithCwd(
800 gitExe(),
801 ['diff', '--cached', '--name-status', '--', filePath],
802 { cwd, timeout: 5000 },
803 )
804
805 if (result.code === 0 && result.stdout) {
806 // Format: "D\tfilename" for deleted files
807 return result.stdout.trim().startsWith('D\t')
808 }
809 } catch {
810 // Ignore errors
811 }
812
813 return false
814}
815
816/**
817 * Get staged files from git.

Callers 1

Calls 2

getAttributionRepoRootFunction · 0.85
execFileNoThrowWithCwdFunction · 0.85

Tested by

no test coverage detected