Exemplo n.º 1
0
        public override string ToString()
        {
            StringBuilder r = new StringBuilder();

            r.Append("Commit");
            r.Append("={\n");
            r.Append("tree ");
            r.Append(treeId != null ? treeId.Name : "NOT_SET");
            r.Append("\n");
            foreach (ObjectId p in parentIds)
            {
                r.Append("parent ");
                r.Append(p.Name);
                r.Append("\n");
            }
            r.Append("author ");
            r.Append(author != null ? author.ToString() : "NOT_SET");
            r.Append("\n");
            r.Append("committer ");
            r.Append(committer != null ? committer.ToString() : "NOT_SET");
            r.Append("\n");
            if (encoding != null && encoding != Constants.CHARSET)
            {
                r.Append("encoding ");
                r.Append(encoding.Name());
                r.Append("\n");
            }
            r.Append("\n");
            r.Append(message != null ? message : string.Empty);
            r.Append("}");
            return(r.ToString());
        }
Exemplo n.º 2
0
		protected internal virtual string GenerateContentType(string boundary, Encoding charset
			)
		{
			StringBuilder buffer = new StringBuilder();
			buffer.Append("multipart/related; boundary=");
			buffer.Append(boundary);
			if (charset != null)
			{
				buffer.Append("; charset=");
				buffer.Append(charset.Name());
			}
			return buffer.ToString();
		}