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

Function oid_bytes_as_hex

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

Lowercase hexadecimal encoding of a Git object ID, the canonical repository bytes of a gitlink entry (review B4).

(oid: &GitObjectId)

Source from the content-addressed store, hash-verified

1463/// Lowercase hexadecimal encoding of a Git object ID, the canonical
1464/// repository bytes of a gitlink entry (review B4).
1465fn oid_bytes_as_hex(oid: &GitObjectId) -> Vec<u8> {
1466 use std::fmt::Write as _;
1467 let mut out = String::with_capacity(oid.as_bytes().len() * 2);
1468 for byte in oid.as_bytes() {
1469 let _ = write!(out, "{byte:02x}");
1470 }
1471 out.into_bytes()
1472}
1473
1474impl ProspectiveProjectTree {
1475 fn new(policy: ConversionPolicy, current: Option<ProjectTree>) -> CliResult<Self> {

Callers 2

parse_diff_filesFunction · 0.85

Calls 2

lenMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected