mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 12:19:09 -04:00
feat(repository): add ability to compare Identity objects (#56)
This commit is contained in:
parent
d231164775
commit
16c42b9b2d
2 changed files with 6 additions and 1 deletions
|
@ -826,10 +826,14 @@ class RepositoryCallback {
|
|||
final String? originUrl;
|
||||
}
|
||||
|
||||
class Identity {
|
||||
@immutable
|
||||
class Identity extends Equatable {
|
||||
/// Identity to use for reflogs.
|
||||
const Identity({required this.name, required this.email});
|
||||
|
||||
final String name;
|
||||
final String email;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [name, email];
|
||||
}
|
||||
|
|
|
@ -85,6 +85,7 @@ void main() {
|
|||
final identity = repo.identity;
|
||||
expect(identity.name, 'name');
|
||||
expect(identity.email, 'email@email.com');
|
||||
expect(identity, equals(repo.identity));
|
||||
});
|
||||
|
||||
test('unsets identity', () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue