mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(reference): add ability to compare references
This commit is contained in:
parent
1f0201d259
commit
7b6e0c36f6
3 changed files with 30 additions and 0 deletions
|
@ -253,6 +253,15 @@ class Reference {
|
|||
/// Throws a [LibGit2Error] if the reference has changed from the time it was looked up.
|
||||
void delete() => bindings.delete(_refPointer);
|
||||
|
||||
@override
|
||||
bool operator ==(other) {
|
||||
return (other is Reference) &&
|
||||
bindings.compare(_refPointer, other._refPointer);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => _refPointer.address.hashCode;
|
||||
|
||||
/// Releases memory allocated for reference object.
|
||||
void free() {
|
||||
bindings.free(_refPointer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue