Welcome to mirror list, hosted at ThFree Co, Russian Federation.

IndexEntry.cs « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 84b5797f89966d770976f2e7b2daf51284cf0492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Runtime.InteropServices;
using LibGit2Sharp.Core;

namespace LibGit2Sharp
{
    public class IndexEntry
    {
        public IndexEntryState State { get; set; }

        public string Path { get; private set; }
        public ObjectId Id { get; private set; }

        internal static IndexEntry CreateFromPtr(IntPtr ptr)
        {
            var entry = (GitIndexEntry) Marshal.PtrToStructure(ptr, typeof (GitIndexEntry));
            return new IndexEntry
                       {
                           Path = entry.Path,
                           Id = new ObjectId(entry.oid),
                       };
        }
    }
}