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

Function run_verify_receive

atomic-cli/src/commands/git/verify_receive.rs:55–66  ·  view source on GitHub ↗

Run the receiving verifier (pre-receive/update/CI contract). Reads ref-update lines on stdin, verifies protected updates, and exits non-zero when any update is refused. `--unprotected ` may be passed repeatedly to exempt explicitly chosen ref prefixes; everything else fails closed.

(root: &Path, unprotected: &[String])

Source from the content-addressed store, hash-verified

53/// passed repeatedly to exempt explicitly chosen ref prefixes; everything
54/// else fails closed.
55pub(crate) fn run_verify_receive(root: &Path, unprotected: &[String]) -> CliResult<()> {
56 let mut stdin = std::io::stdin().lock();
57 let mut input = String::new();
58 stdin
59 .read_to_string(&mut input)
60 .map_err(|error| CliError::GitError {
61 message: format!("cannot read ref-update lines: {error}"),
62 })?;
63 drop(stdin);
64
65 verify_receive_updates(root, unprotected, &input)
66}
67
68/// The stdin-independent core of the verifier (also the test seam).
69pub(crate) fn verify_receive_updates(

Callers 1

runMethod · 0.85

Calls 2

verify_receive_updatesFunction · 0.85
lockMethod · 0.80

Tested by

no test coverage detected