We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79fda22 commit 3c95ea0Copy full SHA for 3c95ea0
1 file changed
gix-commitgraph/src/access.rs
@@ -11,6 +11,20 @@ impl Graph {
11
r.file.commit_at(r.pos)
12
}
13
14
+ /// The kind of hash used in this `Graph`.
15
+ ///
16
+ /// Note that it is always conforming to the hash used in the owning repository.
17
18
+ /// # Panics
19
20
+ /// If the graph does not contain any `File`.
21
+ pub fn object_hash(&self) -> gix_hash::Kind {
22
+ self.files
23
+ .first()
24
+ .map(super::File::object_hash)
25
+ .expect("graph to have at least one file")
26
+ }
27
+
28
/// Returns the commit matching the given `id`.
29
pub fn commit_by_id(&self, id: impl AsRef<gix_hash::oid>) -> Option<Commit<'_>> {
30
let r = self.lookup_by_id(id.as_ref())?;
0 commit comments