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

Method old_bytes_for

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

The diff baseline for one file: bytes the repository already holds, falling back to the Git parent-tree bytes captured in Phase 1 for history whose baseline is not in the graph.

(&self, repo: &Repository, file: &ParsedFile)

Source from the content-addressed store, hash-verified

6981 /// falling back to the Git parent-tree bytes captured in Phase 1 for
6982 /// history whose baseline is not in the graph.
6983 fn old_bytes_for(&self, repo: &Repository, file: &ParsedFile) -> Vec<u8> {
6984 match repo.get_file_content(&*repository_path(&file.path)) {
6985 Ok(Some(bytes)) => bytes,
6986 _ => file.old_content.as_deref().unwrap_or(&[]).to_vec(),
6987 }
6988 }
6989
6990 /// Write an empty Git commit (no file changes) as a distinct
6991 /// `Change::empty` object (CB-9B).

Callers 1

Calls 2

repository_pathFunction · 0.85
get_file_contentMethod · 0.80

Tested by

no test coverage detected