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

This commit is contained in:
Aleksey Kulikov 2022-06-09 17:15:55 +03:00 committed by GitHub
parent a708d54b0a
commit 48e2240c73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);