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

Function parse_atomic_changes_trailer

atomic-cli/src/commands/git/parallel.rs:3478–3493  ·  view source on GitHub ↗

Parse "Atomic-Changes: HASH1, HASH2, ..." from a commit message.

(message: &str)

Source from the content-addressed store, hash-verified

3476
3477/// Parse "Atomic-Changes: HASH1, HASH2, ..." from a commit message.
3478fn parse_atomic_changes_trailer(message: &str) -> Option<Vec<String>> {
3479 for line in message.lines() {
3480 let line = line.trim();
3481 if let Some(rest) = line.strip_prefix("Atomic-Changes:") {
3482 let hashes: Vec<String> = rest
3483 .split(',')
3484 .map(|s| s.trim().to_string())
3485 .filter(|s| !s.is_empty())
3486 .collect();
3487 if !hashes.is_empty() {
3488 return Some(hashes);
3489 }
3490 }
3491 }
3492 None
3493}
3494
3495/// Parse a PR/MR number from a commit message.
3496///

Callers 2

classify_commitFunction · 0.85

Calls 2

linesMethod · 0.45
is_emptyMethod · 0.45

Tested by 1