/// <summary> /// Write an annotated Tag to the object database /// </summary> /// <param name="tag">Tag</param> /// <returns>SHA-1 of the tag.</returns> /// <exception cref="IOException"></exception> public ObjectId WriteTag(Tag tag) { var output = new MemoryStream(); var s = new BinaryWriter(output); s.Write("object ".ToCharArray()); tag.Id.CopyTo(s); s.Write('\n'); s.Write("type ".ToCharArray()); s.Write(tag.TagType.ToCharArray()); s.Write('\n'); s.Write("tag ".ToCharArray()); s.Write(tag.TagName.ToCharArray()); s.Write('\n'); s.Write("tagger ".ToCharArray()); s.Write(tag.Author.ToExternalString().ToCharArray()); s.Write('\n'); s.Write('\n'); s.Write(tag.Message.ToCharArray()); s.Close(); return WriteTag(output.ToArray()); }
public ObjectId WriteTag(Tag tag) { var stream = new MemoryStream(); var w = new BinaryWriter(stream); var sw = new StreamWriter(stream); sw.Write("object "); tag.Id.CopyTo(stream); w.Write('\n'); sw.Write("type "); w.Write(tag.TagType); w.Write('\n'); sw.Write("tag "); sw.Write(tag.TagName); w.Write('\n'); sw.Write("tagger "); sw.Write(tag.Author.ToExternalString()); w.Write('\n'); w.Write('\n'); sw.Write(tag.Message); w.Close(); return WriteTag(stream.ToArray()); }
private void SelectTag(Tag tag) { if (tag == null) return; //if (tag.Object is Commit) // DisplayCommit(tag.Object as Commit, "Tag "+tag.Name); }