The complete lowercase-hex Git ancestry of `sha` (the commit itself and every transitive parent), walked on the live object database. Used by the bound-range containment probe to skip ancestors, whose content is trivially contained in any descendant.
(git: &GitRepository, sha: &str)
| 1089 | /// bound-range containment probe to skip ancestors, whose content is |
| 1090 | /// trivially contained in any descendant. |
| 1091 | fn standalone_git_ancestry(git: &GitRepository, sha: &str) -> CliResult<HashSet<String>> { |
| 1092 | let oid = git2::Oid::from_str(sha) |
| 1093 | .map_err(|e| git_error(format!("cannot parse commit oid '{sha}': {e}")))?; |
| 1094 | let commit = git.find_commit(oid).map_err(|e| CliError::GitError { |
| 1095 | message: format!("cannot read commit {sha} for ancestry: {e}"), |
| 1096 | })?; |
| 1097 | let mut set: HashSet<String> = HashSet::new(); |
| 1098 | set.insert(sha.to_ascii_lowercase()); |
| 1099 | for parent in commit.parent_ids() { |
| 1100 | set.extend(standalone_git_ancestry(git, &parent.to_string())?); |
| 1101 | } |
| 1102 | Ok(set) |
| 1103 | } |
| 1104 | |
| 1105 | /// The tree of commit `sha`, or `None` when it is not locally readable. |
| 1106 | fn commit_tree_of<'r>(git: &'r GitRepository, sha: &str) -> Option<git2::Tree<'r>> { |