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); }
/// <summary> /// Initializes a new instance of the <see cref="Filter"/> class. /// And allocates the filter natively. /// <param name="name">The unique name with which this filtered is registered with</param> /// <param name="attributes">A list of attributes which this filter applies to</param> /// </summary> protected Filter(string name, IEnumerable <FilterAttributeEntry> attributes) { Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(attributes, "attributes"); this.name = name; this.attributes = attributes; var attributesAsString = string.Join(",", this.attributes.Select(attr => attr.FilterDefinition)); gitFilter = new GitFilter { attributes = EncodingMarshaler.FromManaged(Encoding.UTF8, attributesAsString), init = InitializeCallback, stream = StreamCreateCallback, }; }