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])
| 53 | /// passed repeatedly to exempt explicitly chosen ref prefixes; everything |
| 54 | /// else fails closed. |
| 55 | pub(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). |
| 69 | pub(crate) fn verify_receive_updates( |
no test coverage detected