MCPcopy
hub / github.com/openai/codex-plugin-cc / getWorkingTreeState

Function getWorkingTreeState

plugins/codex/scripts/lib/git.mjs:121–132  ·  view source on GitHub ↗
(cwd)

Source from the content-addressed store, hash-verified

119}
120
121export function getWorkingTreeState(cwd) {
122 const staged = gitChecked(cwd, ["diff", "--cached", "--name-only"]).stdout.trim().split("\n").filter(Boolean);
123 const unstaged = gitChecked(cwd, ["diff", "--name-only"]).stdout.trim().split("\n").filter(Boolean);
124 const untracked = gitChecked(cwd, ["ls-files", "--others", "--exclude-standard"]).stdout.trim().split("\n").filter(Boolean);
125
126 return {
127 staged,
128 unstaged,
129 untracked,
130 isDirty: staged.length > 0 || unstaged.length > 0 || untracked.length > 0
131 };
132}
133
134export function resolveReviewTarget(cwd, options = {}) {
135 ensureGitRepository(cwd);

Callers 2

resolveReviewTargetFunction · 0.85
collectReviewContextFunction · 0.85

Calls 1

gitCheckedFunction · 0.85

Tested by

no test coverage detected