/// <summary>Parse an annotated tag from its canonical format.</summary> /// <remarks> /// Parse an annotated tag from its canonical format. /// This method inserts the tag directly into the caller supplied revision /// pool, making it appear as though the tag exists in the repository, even /// if it doesn't. The repository under the pool is not affected. /// </remarks> /// <param name="rw"> /// the revision pool to allocate the tag within. The tag's object /// pointer will be obtained from this pool. /// </param> /// <param name="raw">the canonical formatted tag to be parsed.</param> /// <returns> /// the parsed tag, in an isolated revision pool that is not /// available to the caller. /// </returns> /// <exception cref="NGit.Errors.CorruptObjectException">the tag contains a malformed header that cannot be handled. /// </exception> public static NGit.Revwalk.RevTag Parse(RevWalk rw, byte[] raw) { ObjectInserter.Formatter fmt = new ObjectInserter.Formatter(); bool retain = rw.IsRetainBody(); rw.SetRetainBody(true); NGit.Revwalk.RevTag r = rw.LookupTag(fmt.IdFor(Constants.OBJ_TAG, raw)); r.ParseCanonical(rw, raw); rw.SetRetainBody(retain); return(r); }
/// <summary>Parse an annotated tag from its canonical format.</summary> /// <remarks> /// Parse an annotated tag from its canonical format. /// This method inserts the tag directly into the caller supplied revision /// pool, making it appear as though the tag exists in the repository, even /// if it doesn't. The repository under the pool is not affected. /// </remarks> /// <param name="rw"> /// the revision pool to allocate the tag within. The tag's object /// pointer will be obtained from this pool. /// </param> /// <param name="raw">the canonical formatted tag to be parsed.</param> /// <returns> /// the parsed tag, in an isolated revision pool that is not /// available to the caller. /// </returns> /// <exception cref="NGit.Errors.CorruptObjectException">the tag contains a malformed header that cannot be handled. /// </exception> public static NGit.Revwalk.RevTag Parse(RevWalk rw, byte[] raw) { ObjectInserter.Formatter fmt = new ObjectInserter.Formatter(); bool retain = rw.IsRetainBody(); rw.SetRetainBody(true); NGit.Revwalk.RevTag r = rw.LookupTag(fmt.IdFor(Constants.OBJ_TAG, raw)); r.ParseCanonical(rw, raw); rw.SetRetainBody(retain); return r; }