mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
Compare commits
2 commits
bad40bdb61
...
16c42b9b2d
Author | SHA1 | Date | |
---|---|---|---|
|
16c42b9b2d | ||
|
d231164775 |
3 changed files with 17 additions and 3 deletions
|
@ -1,8 +1,8 @@
|
||||||
import 'dart:ffi';
|
import 'dart:ffi';
|
||||||
|
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
import 'package:ffi/ffi.dart';
|
import 'package:ffi/ffi.dart';
|
||||||
import 'package:libgit2dart/libgit2dart.dart';
|
import 'package:libgit2dart/libgit2dart.dart';
|
||||||
|
|
||||||
import 'package:libgit2dart/src/bindings/attr.dart' as attr_bindings;
|
import 'package:libgit2dart/src/bindings/attr.dart' as attr_bindings;
|
||||||
import 'package:libgit2dart/src/bindings/describe.dart' as describe_bindings;
|
import 'package:libgit2dart/src/bindings/describe.dart' as describe_bindings;
|
||||||
import 'package:libgit2dart/src/bindings/graph.dart' as graph_bindings;
|
import 'package:libgit2dart/src/bindings/graph.dart' as graph_bindings;
|
||||||
|
@ -12,8 +12,10 @@ import 'package:libgit2dart/src/bindings/repository.dart' as bindings;
|
||||||
import 'package:libgit2dart/src/bindings/reset.dart' as reset_bindings;
|
import 'package:libgit2dart/src/bindings/reset.dart' as reset_bindings;
|
||||||
import 'package:libgit2dart/src/bindings/status.dart' as status_bindings;
|
import 'package:libgit2dart/src/bindings/status.dart' as status_bindings;
|
||||||
import 'package:libgit2dart/src/util.dart';
|
import 'package:libgit2dart/src/util.dart';
|
||||||
|
import 'package:meta/meta.dart';
|
||||||
|
|
||||||
class Repository {
|
@immutable
|
||||||
|
class Repository extends Equatable {
|
||||||
/// Initializes a new instance of the [Repository] class from provided
|
/// Initializes a new instance of the [Repository] class from provided
|
||||||
/// pointer to repository object in memory.
|
/// pointer to repository object in memory.
|
||||||
///
|
///
|
||||||
|
@ -741,6 +743,9 @@ class Repository {
|
||||||
|
|
||||||
return packbuilder.writtenLength;
|
return packbuilder.writtenLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [path];
|
||||||
}
|
}
|
||||||
|
|
||||||
// coverage:ignore-start
|
// coverage:ignore-start
|
||||||
|
@ -821,10 +826,14 @@ class RepositoryCallback {
|
||||||
final String? originUrl;
|
final String? originUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Identity {
|
@immutable
|
||||||
|
class Identity extends Equatable {
|
||||||
/// Identity to use for reflogs.
|
/// Identity to use for reflogs.
|
||||||
const Identity({required this.name, required this.email});
|
const Identity({required this.name, required this.email});
|
||||||
|
|
||||||
final String name;
|
final String name;
|
||||||
final String email;
|
final String email;
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [name, email];
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,7 @@ void main() {
|
||||||
final identity = repo.identity;
|
final identity = repo.identity;
|
||||||
expect(identity.name, 'name');
|
expect(identity.name, 'name');
|
||||||
expect(identity.email, 'email@email.com');
|
expect(identity.email, 'email@email.com');
|
||||||
|
expect(identity, equals(repo.identity));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('unsets identity', () {
|
test('unsets identity', () {
|
||||||
|
|
|
@ -249,5 +249,9 @@ void main() {
|
||||||
test('returns string representation of Repository object', () {
|
test('returns string representation of Repository object', () {
|
||||||
expect(repo.toString(), contains('Repository{'));
|
expect(repo.toString(), contains('Repository{'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('supports value comparison', () {
|
||||||
|
expect(repo, equals(Repository.open(tmpDir.path)));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue