示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }