feat: add more toString overrides for debugging

This commit is contained in:
Aleksey Kulikov 2021-10-13 19:23:34 +03:00
parent beed516c89
commit 9f346c99f7
26 changed files with 175 additions and 18 deletions

View file

@ -220,6 +220,9 @@ class Index with IterableMixin<IndexEntry> {
/// Releases memory allocated for index object.
void free() => bindings.free(_indexPointer);
@override
String toString() => 'Index{hasConflicts: $hasConflicts}';
@override
Iterator<IndexEntry> get iterator => _IndexIterator(_indexPointer);
}
@ -261,7 +264,7 @@ class IndexEntry {
@override
String toString() {
return 'IndexEntry{path: $path, sha: $sha}';
return 'IndexEntry{oid: $oid, path: $path, mode: $mode}';
}
String _oidToHex(git_oid oid) {
@ -306,7 +309,7 @@ class ConflictEntry {
@override
String toString() =>
'ConflictEntry{ancestor: $ancestor, our: $our, their: $their}';
'ConflictEntry{ancestor: $ancestor, our: $our, their: $their, path: $_path}';
}
class _IndexIterator implements Iterator<IndexEntry> {