mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(merge): add ability to merge file from index
This commit is contained in:
parent
5c8d6647eb
commit
52707dcc63
4 changed files with 87 additions and 1 deletions
|
@ -256,9 +256,11 @@ class IndexEntry {
|
|||
/// Initializes a new instance of [IndexEntry] class.
|
||||
const IndexEntry(this._indexEntryPointer);
|
||||
|
||||
/// Pointer to memory address for allocated index entry object.
|
||||
final Pointer<git_index_entry> _indexEntryPointer;
|
||||
|
||||
/// Pointer to memory address for allocated index entry object.
|
||||
Pointer<git_index_entry> get pointer => _indexEntryPointer;
|
||||
|
||||
/// Unique identity of the index entry.
|
||||
Oid get id => Oid.fromRaw(_indexEntryPointer.ref.id);
|
||||
|
||||
|
@ -282,6 +284,11 @@ class IndexEntry {
|
|||
/// Sets the UNIX file attributes of a index entry.
|
||||
set mode(GitFilemode mode) => _indexEntryPointer.ref.mode = mode.value;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'IndexEntry{path: $path, sha: $sha}';
|
||||
}
|
||||
|
||||
String _oidToHex(git_oid oid) {
|
||||
var hex = StringBuffer();
|
||||
for (var i = 0; i < 20; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue