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.
Showing the changes to git-commitgraph/src/graph_file/commit_data.rs (1 of 41 files). Show all
Unified · Split
| @@ -80,7 +80,7 @@ impl<'a> CommitData<'a> { · 79 unmodified lines | |||
| 80 | self.generation | 80 | self.generation |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 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 { |
| 84 | // I didn't find a combinator approach that a) was as strict as ParentIterator, b) supported | 84 | // I didn't find a combinator approach that a) was as strict as ParentIterator, b) supported |
| 85 | // fuse-after-first-error behavior, and b) was significantly shorter or more understandable | 85 | // fuse-after-first-error behavior, and b) was significantly shorter or more understandable |
| 86 | // than ParentIterator. So here we are. | 86 | // than ParentIterator. So here we are. |
| @@ -95,7 +95,7 @@ impl<'a> CommitData<'a> { · 8 unmodified lines | |||
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | pub fn parent1(&self) -> Result<Option<GraphPosition>, Error> { | 97 | pub fn parent1(&self) -> Result<Option<GraphPosition>, Error> { |
| 98 | self.iter_parent_indices().next().transpose() | 98 | self.iter_parents().next().transpose() |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | pub fn root_tree_id(&self) -> borrowed::Id { | 101 | pub fn root_tree_id(&self) -> borrowed::Id { |