MCPcopy Create free account
hub / github.com/douglance/devsql / walk_commits

Method walk_commits

crates/vcsql/src/git/repository.rs:81–93  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

79 }
80
81 pub fn walk_commits(&self) -> Result<impl Iterator<Item = Result<Commit<'_>>>> {
82 let mut revwalk = self.repo.revwalk()?;
83 revwalk.push_head()?;
84 revwalk.set_sorting(git2::Sort::TIME | git2::Sort::TOPOLOGICAL)?;
85
86 Ok(revwalk.map(move |oid_result| match oid_result {
87 Ok(oid) => self
88 .repo
89 .find_commit(oid)
90 .map_err(VcsqlError::Git),
91 Err(e) => Err(VcsqlError::Git(e)),
92 }))
93 }
94
95 pub fn branches(&self, branch_type: Option<BranchType>) -> Result<git2::Branches<'_>> {
96 Ok(self.repo.branches(branch_type)?)

Callers 4

populateMethod · 0.80
populateMethod · 0.80
populateMethod · 0.80
populateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected