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

Function validate_hook_oid

atomic-cli/src/commands/git/hooks.rs:1494–1501  ·  view source on GitHub ↗
(label: &str, value: &str)

Source from the content-addressed store, hash-verified

1492}
1493
1494fn validate_hook_oid(label: &str, value: &str) -> CliResult<()> {
1495 if !matches!(value.len(), 40 | 64) || !value.bytes().all(|byte| byte.is_ascii_hexdigit()) {
1496 return Err(git_error(format!(
1497 "{label} from post-checkout is not a hexadecimal Git object ID"
1498 )));
1499 }
1500 Ok(())
1501}
1502
1503fn append_journal_record<T: Serialize>(root: &Path, record: &T) -> CliResult<()> {
1504 let path = root.join(EVENT_JOURNAL_RELATIVE);

Callers 2

record_post_rewriteFunction · 0.85
persist_checkout_eventFunction · 0.85

Calls 3

git_errorFunction · 0.70
allMethod · 0.45
bytesMethod · 0.45

Tested by

no test coverage detected