(cwd)
| 119 | } |
| 120 | |
| 121 | export 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 | |
| 134 | export function resolveReviewTarget(cwd, options = {}) { |
| 135 | ensureGitRepository(cwd); |
no test coverage detected