mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-06 13:09:07 -04:00
add name_to_id binding and headCommit to repo
- implemented git_reference_name_to_id binding - created repository.headCommit getter
This commit is contained in:
parent
b66662f33c
commit
35afc87b58
5 changed files with 58 additions and 0 deletions
|
@ -530,6 +530,11 @@ void main() {
|
|||
);
|
||||
});
|
||||
|
||||
test('get oid by name', () {
|
||||
final oid = Reference.nameToId(repo: repo, refName: 'HEAD');
|
||||
expect(oid, repo.head.target);
|
||||
});
|
||||
|
||||
test('manually releases allocated memory', () {
|
||||
final ref = Reference.lookup(repo: repo, name: 'refs/heads/master');
|
||||
expect(() => ref.free(), returnsNormally);
|
||||
|
|
|
@ -246,6 +246,10 @@ void main() {
|
|||
expect(() => repo.free(), returnsNormally);
|
||||
});
|
||||
|
||||
test('get head commit', () {
|
||||
expect(repo.headCommit.oid.sha, lastCommit);
|
||||
});
|
||||
|
||||
test('returns string representation of Repository object', () {
|
||||
expect(repo.toString(), contains('Repository{'));
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue