Exemplo n.º 1
0
 private unsafe IndexReucEntry this[int idx]
 {
     get
     {
         git_index_reuc_entry *entryHandle = Proxy.git_index_reuc_get_byindex(index.Handle, (UIntPtr)idx);
         return(IndexReucEntry.BuildFromPtr(entryHandle));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the <see cref="IndexReucEntry"/> with the specified relative path.
        /// </summary>
        public virtual unsafe IndexReucEntry this[string path]
        {
            get
            {
                Ensure.ArgumentNotNullOrEmptyString(path, "path");

                git_index_reuc_entry *entryHandle = Proxy.git_index_reuc_get_bypath(index.Handle, path);
                return(IndexReucEntry.BuildFromPtr(entryHandle));
            }
        }
Exemplo n.º 3
0
        internal static unsafe IndexReucEntry BuildFromPtr(git_index_reuc_entry *entry)
        {
            if (entry == null)
            {
                return(null);
            }

            FilePath path = LaxUtf8Marshaler.FromNative(entry->Path);

            return(new IndexReucEntry
            {
                Path = path.Native,
                AncestorId = ObjectId.BuildFromPtr(&entry->AncestorId),
                AncestorMode = (Mode)entry->AncestorMode,
                OurId = ObjectId.BuildFromPtr(&entry->OurId),
                OurMode = (Mode)entry->OurMode,
                TheirId = ObjectId.BuildFromPtr(&entry->TheirId),
                TheirMode = (Mode)entry->TheirMode,
            });
        }