private void ReplaceIndexEntryWith(TreeEntryChanges treeEntryChanges) { var indexEntry = new GitIndexEntry { Mode = (uint)treeEntryChanges.OldMode, Id = treeEntryChanges.OldOid.Oid, Path = StrictFilePathMarshaler.FromManaged(treeEntryChanges.OldPath), }; Proxy.git_index_add(handle, indexEntry); EncodingMarshaler.Cleanup(indexEntry.Path); }
private void AddEntryToTheIndex(string path, ObjectId id, Mode mode) { var indexEntry = new GitIndexEntry { Mode = (uint)mode, Id = id.Oid, Path = StrictFilePathMarshaler.FromManaged(path), }; Proxy.git_index_add(handle, indexEntry); EncodingMarshaler.Cleanup(indexEntry.Path); }
private unsafe void AddEntryToTheIndex(string path, ObjectId id, Mode mode) { IntPtr pathPtr = StrictFilePathMarshaler.FromManaged(path); var indexEntry = new git_index_entry { mode = (uint)mode, path = (char *)pathPtr, }; Marshal.Copy(id.RawId, 0, new IntPtr(indexEntry.id.Id), GitOid.Size); Proxy.git_index_add(handle, &indexEntry); EncodingMarshaler.Cleanup(pathPtr); }