Esempio n. 1
0
        internal static Note BuildFromPtr(NoteSafeHandle note, string @namespace, ObjectId targetObjectId)
        {
            ObjectId oid     = Proxy.git_note_oid(note);
            string   message = Proxy.git_note_message(note);

            return(new Note(oid, message, targetObjectId, @namespace));
        }
Esempio n. 2
0
 internal Note RetrieveNote(ObjectId targetObjectId, string canonicalNamespace)
 {
     using (NoteSafeHandle noteHandle = Proxy.git_note_read(repo.Handle, canonicalNamespace, targetObjectId))
     {
         return(noteHandle == null ? null :
                Note.BuildFromPtr(noteHandle, UnCanonicalizeName(canonicalNamespace), targetObjectId));
     }
 }
Esempio n. 3
0
        internal Note RetrieveNote(ObjectId targetObjectId, string canonicalNamespace)
        {
            using (NoteSafeHandle noteHandle = BuildNoteSafeHandle(targetObjectId, canonicalNamespace))
            {
                if (noteHandle == null)
                {
                    return(null);
                }

                return(Note.BuildFromPtr(repo, UnCanonicalizeName(canonicalNamespace), targetObjectId, noteHandle));
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the <see cref="Note"/> associated with the specified objectId and the specified namespace.
        /// </summary>
        public virtual Note this[string @namespace, ObjectId id]
        {
            get
            {
                Ensure.ArgumentNotNull(id, "id");
                Ensure.ArgumentNotNull(@namespace, "@namespace");

                string canonicalNamespace = NormalizeToCanonicalName(@namespace);

                using (NoteSafeHandle noteHandle = Proxy.git_note_read(repo.Handle, canonicalNamespace, id))
                {
                    return(noteHandle == null
                        ? null
                        : Note.BuildFromPtr(noteHandle, UnCanonicalizeName(canonicalNamespace), id));
                }
            }
        }
Esempio n. 5
0
 public static extern int git_note_read(
     out NoteSafeHandle note,
     RepositorySafeHandle repo,
     [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string notes_ref,
     ref GitOid oid);
Esempio n. 6
0
 public static extern OidSafeHandle git_note_oid(NoteSafeHandle note);
Esempio n. 7
0
 public static extern string git_note_message(NoteSafeHandle note);
Esempio n. 8
0
        internal static Note BuildFromPtr(Repository repo, string @namespace, ObjectId targetObjectId, NoteSafeHandle note)
        {
            ObjectId oid     = NativeMethods.git_note_oid(note).MarshalAsObjectId();
            string   message = NativeMethods.git_note_message(note);

            return(new Note(oid, message, targetObjectId, @namespace));
        }
Esempio n. 9
0
 internal static extern OidSafeHandle git_note_oid(NoteSafeHandle note);