MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getStagedFiles

Function getStagedFiles

src/utils/commitAttribution.ts:817–835  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

815 * Get staged files from git.
816 */
817export async function getStagedFiles(): Promise<string[]> {
818 const cwd = getAttributionRepoRoot()
819
820 try {
821 const result = await execFileNoThrowWithCwd(
822 gitExe(),
823 ['diff', '--cached', '--name-only'],
824 { cwd, timeout: 5000 },
825 )
826
827 if (result.code === 0 && result.stdout) {
828 return result.stdout.split('\n').filter(Boolean)
829 }
830 } catch (error) {
831 logError(error as Error)
832 }
833
834 return []
835}
836
837// formatAttributionTrailer moved to attributionTrailer.ts for tree-shaking
838// (contains excluded strings that should not be in external builds)

Callers

nothing calls this directly

Calls 3

getAttributionRepoRootFunction · 0.85
execFileNoThrowWithCwdFunction · 0.85
logErrorFunction · 0.70

Tested by

no test coverage detected