예제 #1
0
 private IndexEntry this[uint index]
 {
     get
     {
         IndexEntrySafeHandle entryHandle = NativeMethods.git_index_get(handle, index);
         return(IndexEntry.CreateFromPtr(repo, entryHandle));
     }
 }
예제 #2
0
 private IndexEntry this[int index]
 {
     get
     {
         IndexEntrySafeHandle entryHandle = Proxy.git_index_get_byindex(handle, (UIntPtr)index);
         return(IndexEntry.BuildFromPtr(entryHandle));
     }
 }
예제 #3
0
        /// <summary>
        /// Gets the <see cref="IndexEntry"/> with the specified relative path.
        /// </summary>
        public virtual IndexEntry this[string path]
        {
            get
            {
                Ensure.ArgumentNotNullOrEmptyString(path, "path");

                IndexEntrySafeHandle entryHandle = Proxy.git_index_get_bypath(handle, path, 0);
                return(IndexEntry.BuildFromPtr(entryHandle));
            }
        }
예제 #4
0
        internal static IndexEntry CreateFromPtr(Repository repo, IndexEntrySafeHandle handle)
        {
            GitIndexEntry entry = handle.MarshalAsGitIndexEntry();

            FilePath path = (string)marshaler.MarshalNativeToManaged(entry.Path);

            return(new IndexEntry
            {
                Path = path.Native,
                Id = new ObjectId(entry.oid),
                state = () => repo.Index.RetrieveStatus(path.Native)
            });
        }
예제 #5
0
        internal static IndexEntry BuildFromPtr(Repository repo, IndexEntrySafeHandle handle)
        {
            if (handle == null || handle.IsZero)
            {
                return(null);
            }

            GitIndexEntry entry = handle.MarshalAsGitIndexEntry();

            var path = FilePathMarshaler.FromNative(entry.Path);

            return(new IndexEntry
            {
                Path = path.Native,
                Id = entry.oid,
                StageLevel = Proxy.git_index_entry_stage(handle),
                Mode = (Mode)entry.Mode
            });
        }
예제 #6
0
        internal static IndexEntry BuildFromPtr(IndexEntrySafeHandle handle)
        {
            if (handle == null || handle.IsZero)
            {
                return(null);
            }

            GitIndexEntry entry = handle.MarshalAsGitIndexEntry();

            FilePath path = LaxFilePathMarshaler.FromNative(entry.Path);

            return(new IndexEntry
            {
                Path = path.Native,
                Id = entry.Id,
                StageLevel = Proxy.git_index_entry_stage(handle),
                Mode = (Mode)entry.Mode,
                AssumeUnchanged = (GitIndexEntry.GIT_IDXENTRY_VALID & entry.Flags) == GitIndexEntry.GIT_IDXENTRY_VALID
            });
        }
예제 #7
0
 internal static extern int git_index_entry_stage(IndexEntrySafeHandle indexentry);
예제 #8
0
 internal static extern int git_index_conflict_get(
     out IndexEntrySafeHandle ancestor,
     out IndexEntrySafeHandle ours,
     out IndexEntrySafeHandle theirs,
     IndexSafeHandle index,
     [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(FilePathMarshaler))] FilePath path);