feat(revwalk): add ability to limit number of commits to walk

This commit is contained in:
Aleksey Kulikov 2022-06-09 17:08:17 +03:00
parent a708d54b0a
commit a2915624bd
3 changed files with 30 additions and 4 deletions

View file

@ -50,6 +50,16 @@ void main() {
}
});
test('walks only number of commits provided with limit', () {
final walker = RevWalk(repo);
walker.push(repo[log.first]);
final commits = walker.walk(limit: 1);
expect(commits.length, 1);
expect(commits[0].oid.sha, log[0]);
});
test('returns list of commits with reverse sorting', () {
final walker = RevWalk(repo);