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)); }
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)); } }
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)); } }
/// <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)); } } }
public static extern int git_note_read( out NoteSafeHandle note, RepositorySafeHandle repo, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))] string notes_ref, ref GitOid oid);
public static extern OidSafeHandle git_note_oid(NoteSafeHandle note);
public static extern string git_note_message(NoteSafeHandle note);
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)); }
internal static extern OidSafeHandle git_note_oid(NoteSafeHandle note);