mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat: override toString with relevant information for debugging
This commit is contained in:
parent
188cdc4354
commit
458c0bdc71
6 changed files with 18 additions and 2 deletions
|
@ -103,4 +103,7 @@ class Commit {
|
||||||
|
|
||||||
/// Releases memory allocated for commit object.
|
/// Releases memory allocated for commit object.
|
||||||
void free() => bindings.free(_commitPointer);
|
void free() => bindings.free(_commitPointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'Commit{id: $id}';
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,4 +251,8 @@ class ConflictEntry {
|
||||||
///
|
///
|
||||||
/// Throws a [LibGit2Error] if error occured.
|
/// Throws a [LibGit2Error] if error occured.
|
||||||
void remove() => bindings.conflictRemove(_indexPointer, _path);
|
void remove() => bindings.conflictRemove(_indexPointer, _path);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'ConflictEntry{ancestor: $ancestor, our: $our, their: $their}';
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,4 +74,7 @@ class Oid {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => _oidPointer.address.hashCode;
|
int get hashCode => _oidPointer.address.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'Oid{sha: $sha}';
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,4 +58,7 @@ class RefLogEntry {
|
||||||
|
|
||||||
/// Returns the committer of this entry.
|
/// Returns the committer of this entry.
|
||||||
Signature get committer => Signature(bindings.entryCommiter(_entryPointer));
|
Signature get committer => Signature(bindings.entryCommiter(_entryPointer));
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'ReflogEntry{message: $message}';
|
||||||
}
|
}
|
||||||
|
|
|
@ -357,11 +357,11 @@ class Repository {
|
||||||
/// Returns the list of commits starting from provided [sha] hex string.
|
/// Returns the list of commits starting from provided [sha] hex string.
|
||||||
///
|
///
|
||||||
/// If [sorting] isn't provided default will be used (reverse chronological order, like in git).
|
/// If [sorting] isn't provided default will be used (reverse chronological order, like in git).
|
||||||
List<Commit> log(String sha, [List<GitSort>? sorting]) {
|
List<Commit> log(String sha, [List<GitSort> sorting = const [GitSort.none]]) {
|
||||||
final oid = Oid.fromSHA(this, sha);
|
final oid = Oid.fromSHA(this, sha);
|
||||||
final walker = RevWalk(this);
|
final walker = RevWalk(this);
|
||||||
|
|
||||||
walker.sorting(sorting ?? [GitSort.none]);
|
walker.sorting(sorting);
|
||||||
walker.push(oid);
|
walker.push(oid);
|
||||||
final result = walker.walk();
|
final result = walker.walk();
|
||||||
|
|
||||||
|
|
|
@ -120,4 +120,7 @@ class TreeEntry {
|
||||||
|
|
||||||
/// Releases memory allocated for tree entry object.
|
/// Releases memory allocated for tree entry object.
|
||||||
void free() => bindings.entryFree(_treeEntryPointer);
|
void free() => bindings.entryFree(_treeEntryPointer);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'TreeEntry{id: $id, name: $name}';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue