/// <summary>Parse the author identity from the raw buffer.</summary> /// <remarks> /// Parse the author identity from the raw buffer. /// <p> /// This method parses and returns the content of the author line, after /// taking the commit's character set into account and decoding the author /// name and email address. This method is fairly expensive and produces a /// new PersonIdent instance on each invocation. Callers should invoke this /// method only if they are certain they will be outputting the result, and /// should cache the return value for as long as necessary to use all /// information from it. /// <p> /// RevFilter implementations should try to use /// <see cref="NGit.Util.RawParseUtils">NGit.Util.RawParseUtils</see> /// to scan /// the /// <see cref="RawBuffer()">RawBuffer()</see> /// instead, as this will allow faster evaluation /// of commits. /// </remarks> /// <returns> /// identity of the author (name, email) and the time the commit was /// made by the author; null if no author line was found. /// </returns> public PersonIdent GetAuthorIdent() { byte[] raw = buffer; int nameB = RawParseUtils.Author(raw, 0); if (nameB < 0) { return(null); } return(RawParseUtils.ParsePersonIdent(raw, nameB)); }
// Don't permit us to be created. internal static RawCharSequence TextFor(RevCommit cmit) { byte[] raw = cmit.RawBuffer; int b = RawParseUtils.Author(raw, 0); if (b < 0) { return(RawCharSequence.EMPTY); } int e = RawParseUtils.NextLF(raw, b, '>'); return(new RawCharSequence(raw, b, e)); }