History

[commitgraph] Ditch pre-generated test repos.

Always generate test repos on demand instead. This saves some repo space and keeps us from having to worry about fixture scripts being out of sync with the generated fixtures. It also lets us use git to inspect repos instead of hardcoding expected commit data. On the flip side, tests take ~400ms instead of ~20ms.

Conor Davis committed 6 years ago

Commit 1ce84681 parent 724f39141 files · +197 −265Browse files

Showing the changes to git-commitgraph/src/graph_file/commit_data.rs (1 of 41 files). Show all

Unified · Split

git-commitgraph/src/graph_file/commit_data.rs+2−2
@@ -80,7 +80,7 @@ impl<'a> CommitData<'a> { · 79 unmodified lines
8080 self.generation
8181 }
8282
83− pub fn iter_parent_indices(&'a self) -> impl Iterator<Item = Result<GraphPosition, Error>> + 'a {
83+ pub fn iter_parents(&'a self) -> impl Iterator<Item = Result<GraphPosition, Error>> + 'a {
8484 // I didn't find a combinator approach that a) was as strict as ParentIterator, b) supported
8585 // fuse-after-first-error behavior, and b) was significantly shorter or more understandable
8686 // than ParentIterator. So here we are.
@@ -95,7 +95,7 @@ impl<'a> CommitData<'a> { · 8 unmodified lines
9595 }
9696
9797 pub fn parent1(&self) -> Result<Option<GraphPosition>, Error> {
98− self.iter_parent_indices().next().transpose()
98+ self.iter_parents().next().transpose()
9999 }
100100
101101 pub fn root_tree_id(&self) -> borrowed::Id {