Exemple #1
0
 internal override void ParseIndexLine(int ptr, int eol)
 {
     // "index $asha1,$bsha1..$csha1"
     //
     IList<AbbreviatedObjectId> ids = new AList<AbbreviatedObjectId>();
     while (ptr < eol)
     {
         int comma = RawParseUtils.NextLF(buf, ptr, ',');
         if (eol <= comma)
         {
             break;
         }
         ids.AddItem(AbbreviatedObjectId.FromString(buf, ptr, comma - 1));
         ptr = comma;
     }
     oldIds = new AbbreviatedObjectId[ids.Count + 1];
     Sharpen.Collections.ToArray(ids, oldIds);
     int dot2 = RawParseUtils.NextLF(buf, ptr, '.');
     oldIds[ids.Count] = AbbreviatedObjectId.FromString(buf, ptr, dot2 - 1);
     newId = AbbreviatedObjectId.FromString(buf, dot2 + 1, eol - 1);
     oldModes = new FileMode[oldIds.Length];
 }
        protected void parseIndexLine(int ptr, int eol)
        {
            // "index $asha1,$bsha1..$csha1"
            //
            List<AbbreviatedObjectId> ids = new List<AbbreviatedObjectId>();
            while (ptr < eol)
            {
                int comma = RawParseUtils.nextLF(buf, ptr, (byte)',');
                if (eol <= comma)
                    break;
                ids.Add(AbbreviatedObjectId.FromString(buf, ptr, comma - 1));
                ptr = comma;
            }

            //oldIds = new AbbreviatedObjectId[ids.size() + 1];
            oldIds = ids.ToArray();
            int dot2 = RawParseUtils.nextLF(buf, ptr, (byte)'.');
            oldIds[ids.Count] = AbbreviatedObjectId.FromString(buf, ptr, dot2 - 1);
            newId = AbbreviatedObjectId.FromString(buf, dot2 + 1, eol - 1);
            oldModes = new FileMode[oldIds.Length];
        }
        protected override void ParseIndexLine(int ptr, int end)
        {
            // "index $asha1,$bsha1..$csha1"
            //
            var ids = new List<AbbreviatedObjectId>();
            while (ptr < end)
            {
                int comma = RawParseUtils.nextLF(Buffer, ptr, (byte)',');
                if (end <= comma) break;
                ids.Add(AbbreviatedObjectId.FromString(Buffer, ptr, comma - 1));
                ptr = comma;
            }

            _oldIds = new AbbreviatedObjectId[ids.Count + 1];
            ids.CopyTo(_oldIds);
            int dot2 = RawParseUtils.nextLF(Buffer, ptr, (byte)'.');
            _oldIds[_oldIds.Length - 1] = AbbreviatedObjectId.FromString(Buffer, ptr, dot2 - 1);
            NewId = AbbreviatedObjectId.FromString(Buffer, dot2 + 1, end - 1);
            _oldModes = new FileMode[_oldIds.Length];
        }