MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / has_working_copy_changes

Method has_working_copy_changes

atomic-agent/src/turn/orchestrator/mod.rs:414–425  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

412 /// here, a turn that only creates new files exits before `record_turn()`
413 /// can auto-add and record them with provenance.
414 pub(crate) fn has_working_copy_changes(&self) -> bool {
415 let repo = match atomic_repository::Repository::open_readonly(&self.repo_root) {
416 Ok(r) => r,
417 Err(_) => return true, // can't check — assume changes
418 };
419
420 let opts = atomic_repository::status::StatusOptions::fast().with_untracked(true);
421 match repo.status(opts) {
422 Ok(status) => !status.is_clean() || status.has_untracked(),
423 Err(_) => true, // can't check — assume changes
424 }
425 }
426}
427
428impl std::fmt::Debug for TurnOrchestrator {

Callers 1

handle_turn_endMethod · 0.80

Calls 4

with_untrackedMethod · 0.80
has_untrackedMethod · 0.80
statusMethod · 0.45
is_cleanMethod · 0.45

Tested by

no test coverage detected