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

Method requires_force

atomic-cli/src/commands/restore.rs:163–165  ·  view source on GitHub ↗

Whether this invocation must be blocked until `--force` is supplied. Only a whole-working-copy restore (no paths named) is guarded, because it would discard *all* uncommitted work. Naming specific files is explicit consent (like `git restore `), and `--force` / `--dry-run` always bypass the guard.

(&self, has_changes: bool)

Source from the content-addressed store, hash-verified

161 /// explicit consent (like `git restore <file>`), and `--force` /
162 /// `--dry-run` always bypass the guard.
163 fn requires_force(&self, has_changes: bool) -> bool {
164 !self.is_partial() && has_changes && !self.force && !self.dry_run
165 }
166
167 /// Message shown when there is nothing to restore.
168 ///

Callers 1

runMethod · 0.80

Calls 1

is_partialMethod · 0.80

Tested by

no test coverage detected