This constructor tries to accept as many commit-graph-looking paths as possible, such as `.git/objects/info`, `.git/objects/info/commit-graph`, or `.git/objects/info/commit-graphs`.
Showing the changes to gitoxide-core/src/commitgraph (1 of 2 files). Show all
Unified · Split
| @@ -1,4 +1,5 @@ | ||
| 1 | 1 | use anyhow::{Context as AnyhowContext, Result}; |
| 2 | +use git_commitgraph::Graph; | |
| 2 | 3 | use std::{io, path::Path}; |
| 3 | 4 | |
| 4 | 5 | /// A general purpose context for many operations provided here |
| @@ -31,6 +32,6 @@ where · 26 unmodified lines | ||
| 31 | 32 | { |
| 32 | 33 | // TODO: Handle `path` being objects/info, objects/info/commit-graph, |
| 33 | 34 | // or objects/info/commit-graphs/graph-xyz.graph. |
| 34 | − let _g = git_commitgraph::Graph::from_info_dir(path).with_context(|| "Could not open commit graph")?; | |
| 35 | + let _g = Graph::at(path).with_context(|| "Could not open commit graph")?; | |
| 35 | 36 | Err(anyhow::Error::msg("not implemented")) |
| 36 | 37 | } |