mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
test(reference): set target with log message
This commit is contained in:
parent
a1884b4dac
commit
30359f04d6
1 changed files with 16 additions and 0 deletions
|
@ -391,6 +391,22 @@ void main() {
|
||||||
ref.free();
|
ref.free();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('successfully sets target with log message', () {
|
||||||
|
final ref = repo.getReference('HEAD');
|
||||||
|
expect(ref.target.sha, lastCommit);
|
||||||
|
|
||||||
|
repo.setIdentity(name: 'name', email: 'email');
|
||||||
|
ref.setTarget('refs/heads/feature', 'log message');
|
||||||
|
expect(ref.target.sha, '5aecfa0fb97eadaac050ccb99f03c3fb65460ad4');
|
||||||
|
expect(ref.log.first.message, 'log message');
|
||||||
|
expect(ref.log.first.committer['name'], 'name');
|
||||||
|
expect(ref.log.first.committer['email'], 'email');
|
||||||
|
|
||||||
|
// change back for tests purpose
|
||||||
|
ref.setTarget('refs/heads/master');
|
||||||
|
ref.free();
|
||||||
|
});
|
||||||
|
|
||||||
test('throws on invalid target', () {
|
test('throws on invalid target', () {
|
||||||
final ref = repo.getReference('HEAD');
|
final ref = repo.getReference('HEAD');
|
||||||
expect(
|
expect(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue