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

Function read_source

libatomic/src/review/html.rs:360–373  ·  view source on GitHub ↗
(
    repo: &Repository,
    hash: &Hash,
    path: &str,
    side: &str,
    bytes: &mut usize,
)

Source from the content-addressed store, hash-verified

358}
359
360fn read_source(
361 repo: &Repository,
362 hash: &Hash,
363 path: &str,
364 side: &str,
365 bytes: &mut usize,
366) -> SourceText {
367 let result = if side == "before" {
368 repo.get_file_content_before_change(path, hash)
369 } else {
370 repo.get_file_content_after_change(path, hash)
371 };
372 source_text(result, bytes)
373}
374
375fn source_text(
376 result: Result<Option<Vec<u8>>, atomic_repository::RepositoryError>,

Callers 1

sourcesFunction · 0.85

Calls 3

source_textFunction · 0.85

Tested by

no test coverage detected