mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -04:00
feat(revwalk): add bindings and api
This commit is contained in:
parent
e0e3742457
commit
2e0486c641
7 changed files with 424 additions and 0 deletions
|
@ -1,4 +1,7 @@
|
|||
import 'dart:ffi';
|
||||
import 'package:libgit2dart/src/enums.dart';
|
||||
import 'package:libgit2dart/src/revwalk.dart';
|
||||
|
||||
import 'commit.dart';
|
||||
import 'config.dart';
|
||||
import 'index.dart';
|
||||
|
@ -320,4 +323,19 @@ class Repository {
|
|||
}
|
||||
return Commit.lookup(this, oid);
|
||||
}
|
||||
|
||||
/// Returns the list of commits starting from provided [oid].
|
||||
///
|
||||
/// If [sorting] isn't provided default will be used (reverse chronological order, like in git).
|
||||
List<Commit> log(Oid oid, [GitSort sorting = GitSort.none]) {
|
||||
final walker = RevWalk(this);
|
||||
if (sorting != GitSort.none) {
|
||||
walker.sorting(sorting);
|
||||
}
|
||||
walker.push(oid);
|
||||
final result = walker.walk();
|
||||
walker.free();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue