MCPcopy Create free account
hub / github.com/Noumena-Network/code / isFileDeleted

Function isFileDeleted

src/utils/commitAttribution.ts:734–753  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

732 * Check if a file was deleted in the staged changes.
733 */
734export async function isFileDeleted(filePath: string): Promise<boolean> {
735 const cwd = getAttributionRepoRoot()
736
737 try {
738 const result = await execFileNoThrowWithCwd(
739 gitExe(),
740 ['diff', '--cached', '--name-status', '--', filePath],
741 { cwd, timeout: 5000 },
742 )
743
744 if (result.code === 0 && result.stdout) {
745 // Format: "D\tfilename" for deleted files
746 return result.stdout.trim().startsWith('D\t')
747 }
748 } catch {
749 // Ignore errors
750 }
751
752 return false
753}
754
755/**
756 * Get staged files from git.

Callers 1

Calls 2

getAttributionRepoRootFunction · 0.85
execFileNoThrowWithCwdFunction · 0.85

Tested by

no test coverage detected