Skip to content

Commit 3e63721

Browse files
authored
Merge pull request #1720 from neithernut/traverse-broaden-with-tips-ends
Allow `topo::Builder::with_tips` and `with_ends` for non-default pred
2 parents f8ba4b9 + d9426f4 commit 3e63721

File tree

1 file changed

+17
-17
lines changed
  • gix-traverse/src/commit/topo

1 file changed

+17
-17
lines changed

gix-traverse/src/commit/topo/init.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,6 @@ where
4545
}
4646
}
4747

48-
/// Add commits to start reading from.
49-
///
50-
/// The behavior is similar to specifying additional `ends` in `git rev-list --topo-order ^ends tips`.
51-
pub fn with_tips(mut self, tips: impl IntoIterator<Item = impl Into<ObjectId>>) -> Self {
52-
self.tips.extend(tips.into_iter().map(Into::into));
53-
self
54-
}
55-
56-
/// Add commits ending the traversal.
57-
///
58-
/// These commits themselves will not be read, i.e. the behavior is similar to specifying additional
59-
/// `ends` in `git rev-list --topo-order ^ends tips`.
60-
pub fn with_ends(mut self, ends: impl IntoIterator<Item = impl Into<ObjectId>>) -> Self {
61-
self.ends.extend(ends.into_iter().map(Into::into));
62-
self
63-
}
64-
6548
/// Set a `predicate` to filter out revisions from the walk. Can be used to
6649
/// implement e.g. filtering on paths or time. This does *not* exclude the
6750
/// parent(s) of a revision that is excluded. Specify a revision as an 'end'
@@ -87,6 +70,23 @@ where
8770
Find: gix_object::Find,
8871
Predicate: FnMut(&oid) -> bool,
8972
{
73+
/// Add commits to start reading from.
74+
///
75+
/// The behavior is similar to specifying additional `ends` in `git rev-list --topo-order ^ends tips`.
76+
pub fn with_tips(mut self, tips: impl IntoIterator<Item = impl Into<ObjectId>>) -> Self {
77+
self.tips.extend(tips.into_iter().map(Into::into));
78+
self
79+
}
80+
81+
/// Add commits ending the traversal.
82+
///
83+
/// These commits themselves will not be read, i.e. the behavior is similar to specifying additional
84+
/// `ends` in `git rev-list --topo-order ^ends tips`.
85+
pub fn with_ends(mut self, ends: impl IntoIterator<Item = impl Into<ObjectId>>) -> Self {
86+
self.ends.extend(ends.into_iter().map(Into::into));
87+
self
88+
}
89+
9090
/// Set the `sorting` to use for the topological walk.
9191
pub fn sorting(mut self, sorting: Sorting) -> Self {
9292
self.sorting = sorting;

0 commit comments

Comments
 (0)