Collect commit OIDs in topological order (oldest first).
(
&self,
git_repo: &GitRepository,
branch_name: &str,
)
| 5090 | |
| 5091 | /// Collect commit OIDs in topological order (oldest first). |
| 5092 | fn collect_commit_oids( |
| 5093 | &self, |
| 5094 | git_repo: &GitRepository, |
| 5095 | branch_name: &str, |
| 5096 | ) -> CliResult<Vec<Oid>> { |
| 5097 | let reference = git_repo |
| 5098 | .find_branch(branch_name, git2::BranchType::Local) |
| 5099 | .map_err(|e| CliError::GitError { |
| 5100 | message: format!("Branch '{}' not found: {}", branch_name, e), |
| 5101 | })?; |
| 5102 | |
| 5103 | let target_oid = reference.get().target().ok_or_else(|| CliError::GitError { |
| 5104 | message: format!("Branch '{}' has no target commit", branch_name), |
| 5105 | })?; |
| 5106 | self.collect_commit_oids_from_target(git_repo, target_oid) |
| 5107 | } |
| 5108 | |
| 5109 | /// Collect the commit closure behind an explicit tip instead of a branch |
| 5110 | /// reference (§7.5 detached-HEAD adoption: the commit exists without a |