MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / getChangedFiles

Function getChangedFiles

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

Source from the content-addressed store, hash-verified

62};
63
64export const getChangedFiles = async (): Promise<string[]> => {
65 const gitDir = await getGitDir();
66
67 const { stdout: modified } = await execa('git', ['ls-files', '--modified'], {
68 cwd: gitDir
69 });
70
71 const { stdout: others } = await execa(
72 'git',
73 ['ls-files', '--others', '--exclude-standard'],
74 { cwd: gitDir }
75 );
76
77 const files = [...modified.split('\n'), ...others.split('\n')].filter(
78 (file) => !!file
79 );
80
81 return files.sort();
82};
83
84export const gitAdd = async ({ files }: { files: string[] }) => {
85 const gitDir = await getGitDir();

Callers 2

prepareCommitMessageHookFunction · 0.90
commitFunction · 0.90

Calls 4

execaFunction · 0.85
filterMethod · 0.80
getGitDirFunction · 0.70
sortMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…