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

Function getStagedFiles

out/cli.cjs:85666–85679  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85664};
85665var getCoreHooksPath = async () => {
85666 const gitDir = await getGitDir();
85667 const { stdout } = await execa("git", ["config", "core.hooksPath"], {
85668 cwd: gitDir
85669 });
85670 return stdout;
85671};
85672var getStagedFiles = async () => {
85673 const gitDir = await getGitDir();
85674 const { stdout: files } = await execa(
85675 "git",
85676 ["diff", "--name-only", "--cached", "--relative"],
85677 { cwd: gitDir }
85678 );
85679 if (!files) return [];
85680 const filesList = files.split("\n");
85681 const ig = await getOpenCommitIgnore();
85682 const allowedFiles = filesList.filter((file) => !ig.ignores(file));

Callers 2

commitFunction · 0.70
prepareCommitMessageHookFunction · 0.70

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…