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

Function display_git_bytes

atomic-cli/src/commands/git/observation.rs:1489–1499  ·  view source on GitHub ↗

Reversible display for raw Git path/ref bytes.

(bytes: &[u8])

Source from the content-addressed store, hash-verified

1487
1488/// Reversible display for raw Git path/ref bytes.
1489pub fn display_git_bytes(bytes: &[u8]) -> String {
1490 let mut output = String::new();
1491 for byte in bytes {
1492 match *byte {
1493 b' '..=b'~' if *byte != b'\\' => output.push(*byte as char),
1494 b'\\' => output.push_str("\\\\"),
1495 _ => output.push_str(&format!("\\x{byte:02x}")),
1496 }
1497 }
1498 output
1499}
1500
1501#[cfg(test)]
1502mod tests {

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected