feat(repository): add ability to compare Identity objects (#56)

This commit is contained in:
Aleksey Kulikov 2022-05-10 20:50:52 +03:00 committed by GitHub
parent d231164775
commit 16c42b9b2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -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];
}

View file

@ -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', () {