mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(reference): add ability to get log of reference
This commit is contained in:
parent
a97dcaa0d3
commit
58fa54f24a
5 changed files with 30 additions and 7 deletions
|
@ -82,7 +82,8 @@ void main() {
|
|||
final reflogEntry = reflog.entryAt(0);
|
||||
|
||||
expect(reflogEntry.message, 'log message');
|
||||
expect(reflogEntry.committer, {'name': 'name', 'email': 'email'});
|
||||
expect(reflogEntry.committer['name'], 'name');
|
||||
expect(reflogEntry.committer['email'], 'email');
|
||||
|
||||
reflog.free();
|
||||
ref.delete();
|
||||
|
@ -222,7 +223,8 @@ void main() {
|
|||
final reflogEntry = reflog.entryAt(0);
|
||||
|
||||
expect(reflogEntry.message, 'log message');
|
||||
expect(reflogEntry.committer, {'name': 'name', 'email': 'email'});
|
||||
expect(reflogEntry.committer['name'], 'name');
|
||||
expect(reflogEntry.committer['email'], 'email');
|
||||
|
||||
// set HEAD back to master
|
||||
repo
|
||||
|
@ -335,6 +337,12 @@ void main() {
|
|||
});
|
||||
});
|
||||
|
||||
test('returns log for reference', () {
|
||||
final ref = repo.getReference('refs/heads/master');
|
||||
expect(ref.log.last.message, 'commit (initial): init');
|
||||
ref.free();
|
||||
});
|
||||
|
||||
group('isValidName()', () {
|
||||
test('returns true for valid names', () {
|
||||
expect(Reference.isValidName('HEAD'), true);
|
||||
|
|
|
@ -51,6 +51,7 @@ void main() {
|
|||
final entry = reflog.entryAt(0);
|
||||
expect(entry.committer['name'], 'Aleksey Kulikov');
|
||||
expect(entry.committer['email'], 'skinny.mind@gmail.com');
|
||||
expect(entry.committer['when'], 1626091184);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue