refactor!: return sets of git type flags instead of integers

This commit is contained in:
Aleksey Kulikov 2021-09-10 20:22:02 +03:00
parent 050c0eb57a
commit 7618f944c0
12 changed files with 459 additions and 191 deletions

View file

@ -36,8 +36,11 @@ class RevWalk {
/// Changing the sorting mode resets the walker.
///
/// Throws a [LibGit2Error] if error occured.
void sorting(List<GitSort> sorting) {
final sort = sorting.fold(0, (previousValue, e) => e.value);
void sorting(Set<GitSort> sorting) {
final int sort = sorting.fold(
0,
(previousValue, e) => previousValue | e.value,
);
bindings.sorting(_revWalkPointer, sort);
}