コード例 #1
0
        internal static IndexNameEntry BuildFromPtr(IndexNameEntrySafeHandle handle)
        {
            if (handle == null || handle.IsZero)
            {
                return(null);
            }

            GitIndexNameEntry entry = handle.MarshalAsGitIndexNameEntry();

            string ancestor = entry.Ancestor != IntPtr.Zero
                ? LaxFilePathMarshaler.FromNative(entry.Ancestor).Native
                : null;
            string ours = entry.Ours != IntPtr.Zero
                ? LaxFilePathMarshaler.FromNative(entry.Ours).Native
                : null;
            string theirs = entry.Theirs != IntPtr.Zero
                ? LaxFilePathMarshaler.FromNative(entry.Theirs).Native
                : null;

            return(new IndexNameEntry
            {
                Ancestor = ancestor,
                Ours = ours,
                Theirs = theirs,
            });
        }