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

Method has_uncommitted_edits

atomic-cli/src/commands/remove.rs:520–528  ·  view source on GitHub ↗

Whether deleting `path` would destroy uncommitted edits, mirroring the guard `git rm` applies without `-f`. Fails closed: if status cannot be computed the path counts as dirty, so a refusal never deletes bytes it could not verify.

(
        &self,
        repo: &Repository,
        working_copy: atomic_core::WorkingCopyId,
        path: &Path,
    )

Source from the content-addressed store, hash-verified

518 /// Fails closed: if status cannot be computed the path counts as dirty, so a
519 /// refusal never deletes bytes it could not verify.
520 fn has_uncommitted_edits(
521 &self,
522 repo: &Repository,
523 working_copy: atomic_core::WorkingCopyId,
524 path: &Path,
525 ) -> bool {
526 repo.has_uncommitted_edits(working_copy, path)
527 .unwrap_or(true)
528 }
529}
530
531/// Format a count with singular/plural word.

Callers 1

runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected