History

[commitgraph] implement basic, low-level read API

This is just the first pass at ensuring we can read commit-graph files correctly. It does not support anything interesting like reachability, merge-base, or ahead-behind queries.

Conor Davis committed 6 years ago

Commit d1f0e9c1 parent 1b42b3153 files · +1429 −-23Browse files

Showing the changes to git-commitgraph/tests/commitgraph.rs (1 of 53 files). Show all

Unified · Split

git-commitgraph/tests/commitgraph.rs+12−0
@@ -0,0 +1,12 @@
1+use git_object::owned;
2+use std::path::PathBuf;
3+
4+mod access;
5+
6+pub fn fixture_path(path: &str) -> PathBuf {
7+ PathBuf::from("tests").join("fixtures").join(path)
8+}
9+
10+pub fn hex_to_id(hex: &[u8]) -> owned::Id {
11+ owned::Id::from_40_bytes_in_hex(hex).expect("40 bytes hex")
12+}