private IndexEntry this[uint index] { get { IndexEntrySafeHandle entryHandle = NativeMethods.git_index_get(handle, index); return(IndexEntry.CreateFromPtr(repo, entryHandle)); } }
private IndexEntry this[int index] { get { IndexEntrySafeHandle entryHandle = Proxy.git_index_get_byindex(handle, (UIntPtr)index); return(IndexEntry.BuildFromPtr(entryHandle)); } }
/// <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)); } }
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) }); }
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 }); }
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 }); }
internal static extern int git_index_entry_stage(IndexEntrySafeHandle indexentry);
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);