MCPcopy Index your code
hub / github.com/emwalker/digraph / write

Method write

backend/src/git/client.rs:601–625  ·  view source on GitHub ↗
(&self, store: &S)

Source from the content-addressed store, hash-verified

599 }
600
601 pub fn write<S>(&self, store: &S) -> Result<()>
602 where
603 S: SaveChangesForPrefix,
604 {
605 self.indexer.write_repo_changes(store)?;
606
607 let mut update = core::Update::new();
608
609 // Write topics and links
610 for ((repo_id, filename), oid) in self.files.iter() {
611 update.add(*repo_id, filename, oid)?;
612 }
613
614 let index_files = self.indexer.files()?;
615
616 // Write activity logs
617 for (prefix, filename, ser) in index_files {
618 let repo = self.repo(prefix)?;
619 let oid = repo.add_blob(ser.as_bytes())?;
620 update.add(prefix, &filename, &Some(oid))?;
621 }
622
623 let sig = git2::Signature::now("digraph-bot", "digraph-bot@digraph.app")?;
624 update.write(&self.client.root, &sig, &self.commit_message())
625 }
626
627 pub fn save_change(&mut self, repo_id: RepoId, change: &activity::Change) -> Result<()> {
628 self.indexer.add_change(repo_id, &self.client, change)?;

Callers 5

callMethod · 0.45
callMethod · 0.45
callMethod · 0.45
persist_repo_topicMethod · 0.45
mainFunction · 0.45

Calls 8

write_repo_changesMethod · 0.80
filesMethod · 0.80
add_blobMethod · 0.80
as_bytesMethod · 0.80
commit_messageMethod · 0.80
iterMethod · 0.45
addMethod · 0.45
repoMethod · 0.45

Tested by

no test coverage detected