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
This commit is contained in:
parent
a708d54b0a
commit
a2915624bd
3 changed files with 30 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue