Skip to content

Commit a7a8d7c

Browse files
committed
feat: add topo::Builder::with_tips fn for adding tips after from_iters
Currently, `Builder::from_iters` takes as arguments both the tips and ends. Previously, this would be the only possibility for specifying either of them during the building process. To enhance the builder-likeness of `Builder`, we recently introduced a fn for adding additional ends. This change introduces a fn which allows adding additional tips after initial construction of a "fresh" `Builder`, allowing for more usage patterns.
1 parent 1c1d037 commit a7a8d7c

File tree

1 file changed

+7
-0
lines changed
  • gix-traverse/src/commit/topo

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ where
4444
}
4545
}
4646

47+
/// Add commits to start reading from. The behavior is similar to specifying
48+
/// additional `ends` in `git rev-list --topo-order ^ends tips`.
49+
pub fn with_tips(mut self, tips: impl IntoIterator<Item = impl Into<ObjectId>>) -> Self {
50+
self.tips.extend(tips.into_iter().map(Into::into));
51+
self
52+
}
53+
4754
/// Add commits ending the traversal. These commits themselves will not be
4855
/// read, i.e. the behavior is similar to specifying additional `ends` in
4956
/// `git rev-list --topo-order ^ends tips`.

0 commit comments

Comments
 (0)