GitSharp.Core.RefWriter.writeInfoRefs C# (CSharp) Method

writeInfoRefs() public method

public writeInfoRefs ( ) : void
return void
        public void writeInfoRefs()
        {
            StringBuilder w = new StringBuilder();
            char[] tmp = new char[Constants.OBJECT_ID_STRING_LENGTH];
            foreach (Ref r in refs)
            {
                if (Constants.HEAD.Equals(r.Name))
                {
                    // Historically HEAD has never been published through
                    // the INFO_REFS file. This is a mistake, but its the
                    // way things are.
                    //
                    continue;
                }

                r.ObjectId.CopyTo(tmp, w);
                w.Append('\t');
                w.Append(r.Name);
                w.Append('\n');

                if (r.PeeledObjectId != null)
                {
                    r.PeeledObjectId.CopyTo(tmp, w);
                    w.Append('\t');
                    w.Append(r.Name);
                    w.Append("^{}\n");
                }
            }
            writeFile(Constants.INFO_REFS, Constants.encode(w.ToString()));
        }