OpenHome.Git.Commit.Write C# (CSharp) Method

Write() static private method

static private Write ( Repository aRepository, ITree aTree, IEnumerable aParents, IPerson aAuthor, IPerson aCommitter, string aDescription ) : ICommit
aRepository Repository
aTree ITree
aParents IEnumerable
aAuthor IPerson
aCommitter IPerson
aDescription string
return ICommit
        internal static ICommit Write(Repository aRepository, ITree aTree, IEnumerable<ICommit> aParents, IPerson aAuthor, IPerson aCommitter, string aDescription)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("tree " + aTree.Id + "\n");

            foreach (ICommit parent in aParents)
            {
                builder.Append("parent " + parent.Id + "\n");
            }

            builder.Append("author " + PersonTime.String(aAuthor) + "\n");
            builder.Append("committer " + PersonTime.String(aCommitter) + "\n");
            builder.Append("\n");
            builder.Append(aDescription);

            byte[] bytes = ASCIIEncoding.ASCII.GetBytes(builder.ToString());

            string id = aRepository.WriteObject(bytes, EObjectType.Commit);

            // TODO

            return (new Commit(new CommitRef(aRepository, id, bytes)));
        }