Fast check for working copy changes. Uses `StatusOptions::fast()` so turn-end recording sees both tracked changes and untracked files created by the agent. This intentionally includes the untracked filesystem walk: if we ignore untracked files here, a turn that only creates new files exits before `record_turn()` can auto-add and record them with provenance.
(&self)
| 842 | /// here, a turn that only creates new files exits before `record_turn()` |
| 843 | /// can auto-add and record them with provenance. |
| 844 | pub(crate) fn has_working_copy_changes(&self) -> bool { |
| 845 | let repo = match atomic_repository::Repository::open_readonly(&self.repo_root) { |
| 846 | Ok(r) => r, |
| 847 | Err(_) => return true, // can't check — assume changes |
| 848 | }; |
| 849 | |
| 850 | let working_copy = match repo.require_working_copy_id() { |
| 851 | Ok(working_copy) => working_copy, |
| 852 | Err(_) => return true, // can't validate identity — assume changes |
| 853 | }; |
| 854 | let opts = atomic_repository::status::StatusOptions::fast().with_untracked(true); |
| 855 | match repo.status(working_copy, opts) { |
| 856 | Ok(status) => !status.is_clean() || status.has_untracked(), |
| 857 | Err(_) => true, // can't check — assume changes |
| 858 | } |
| 859 | } |
| 860 | |
| 861 | /// Fast gate that also admits Git-only turns (CB-12A, RFC §10.2). |
| 862 | /// |
no test coverage detected