mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -04:00
feat(revwalk): add ability to limit number of commits to walk (#65)
This commit is contained in:
parent
a708d54b0a
commit
48e2240c73
3 changed files with 30 additions and 4 deletions
|
@ -19,11 +19,15 @@ class RevWalk {
|
|||
|
||||
/// Returns the list of commits from the revision walk.
|
||||
///
|
||||
/// [limit] is optional number of commits to walk (by default walks through
|
||||
/// all of the commits pushed onto the walker).
|
||||
///
|
||||
/// Default sorting is reverse chronological order (default in git).
|
||||
List<Commit> walk() {
|
||||
List<Commit> walk({int limit = 0}) {
|
||||
final pointers = bindings.walk(
|
||||
repoPointer: bindings.repository(_revWalkPointer),
|
||||
walkerPointer: _revWalkPointer,
|
||||
limit: limit,
|
||||
);
|
||||
|
||||
return pointers.map((e) => Commit(e)).toList();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue