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

Function parse_forensic_digest

atomic-cli/tests/it/git_wip_cb0b_test.rs:64–75  ·  view source on GitHub ↗
(output: &[u8])

Source from the content-addressed store, hash-verified

62}
63
64fn parse_forensic_digest(output: &[u8]) -> String {
65 let text = String::from_utf8_lossy(output);
66 let line = text
67 .lines()
68 .find(|line| line.trim_start().starts_with("refs:") && line.contains("digest "))
69 .expect("forensic refs digest line");
70 line.split("digest ")
71 .nth(1)
72 .expect("digest suffix")
73 .trim_end_matches(')')
74 .to_string()
75}
76
77fn atomic(root: &Path, home: &Path, args: &[&str]) -> Output {
78 Command::new(ATOMIC_BIN)

Calls 2

linesMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected