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

Method insert_shared

atomic-repository/src/repository/project_tree.rs:865–874  ·  view source on GitHub ↗

[`Self::insert`] for bytes another holder already shares (a repository entry's bytes): no copy is made.

(
        &mut self,
        algorithm: GitHashAlgorithm,
        kind: GitObjectKind,
        bytes: Arc<[u8]>,
    )

Source from the content-addressed store, hash-verified

863 /// [`Self::insert`] for bytes another holder already shares (a
864 /// repository entry's bytes): no copy is made.
865 pub fn insert_shared(
866 &mut self,
867 algorithm: GitHashAlgorithm,
868 kind: GitObjectKind,
869 bytes: Arc<[u8]>,
870 ) -> Result<GitObjectId, ProjectTreeError> {
871 let oid = git_object_id(algorithm, kind, &bytes)?;
872 self.objects.insert(oid.clone(), GitObject { kind, bytes });
873 Ok(oid)
874 }
875
876 pub fn parse_manifest(
877 &self,

Callers 2

insertMethod · 0.80
write_directoryFunction · 0.80

Calls 3

git_object_idFunction · 0.70
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected