MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / record_optional_artifact

Function record_optional_artifact

src/migrate/inventory.rs:679–701  ·  view source on GitHub ↗
(
    data_dir: &Path,
    kind: &str,
    relpath: &str,
    artifacts: &mut Vec<StoreArtifact>,
)

Source from the content-addressed store, hash-verified

677}
678
679fn record_optional_artifact(
680 data_dir: &Path,
681 kind: &str,
682 relpath: &str,
683 artifacts: &mut Vec<StoreArtifact>,
684) {
685 let path = data_dir.join(relpath);
686 if path.is_file() {
687 let size_bytes = file_size(&path);
688 artifacts.push(StoreArtifact {
689 kind: kind.to_string(),
690 size_bytes,
691 path,
692 });
693 } else if path.is_dir() {
694 let size_bytes = dir_size(&path);
695 artifacts.push(StoreArtifact {
696 kind: kind.to_string(),
697 size_bytes,
698 path,
699 });
700 }
701}
702
703async fn record_branch_db_artifacts(
704 data_dir: &Path,

Callers 1

inspect_project_storeFunction · 0.85

Calls 3

dir_sizeFunction · 0.85
pushMethod · 0.80
file_sizeFunction · 0.70

Tested by

no test coverage detected