private void ResolveChildDeltaChain(int type, byte[] data, UnresolvedDelta a) { while (a != null) { ResolveDeltas(a.HeaderOffset, a.Crc32, type, data, null); a = a.Next; } }
private void ResolveChildDeltaChain(int type, byte[] data, UnresolvedDelta a) { while (a != null) { ResolveDeltas(a.Position, a.Crc, type, data, null); a = a.Next; } }
public UnresolvedDelta Remove() { UnresolvedDelta r = Head; if (r != null) { Head = null; } return(r); }
private static UnresolvedDelta Reverse(UnresolvedDelta c) { UnresolvedDelta tail = null; while (c != null) { UnresolvedDelta n = c.Next; c.Next = tail; tail = c; c = n; } return(tail); }
private void ResolveChildDeltas(long pos, int type, byte[] data, AnyObjectId objectId) { UnresolvedDelta a = Reverse(RemoveBaseById(objectId)); UnresolvedDelta b = Reverse(_baseByPos.remove(pos)); while (a != null && b != null) { if (a.Position < b.Position) { ResolveDeltas(a.Position, a.Crc, type, data, null); a = a.Next; } else { ResolveDeltas(b.Position, b.Crc, type, data, null); b = b.Next; } } ResolveChildDeltaChain(type, data, a); ResolveChildDeltaChain(type, data, b); }
private void ResolveChildDeltaChain(int type, byte[] data, UnresolvedDelta a) { while (a != null) { ResolveDeltas(a.HeaderOffset, a.Crc32, type, data, null); a = a.Next; } }
private void IndexOneObject() { long pos = Position(); _crc.Reset(); int c = ReadFromInput(); int typeCode = (c >> 4) & 7; long sz = c & 15; int shift = 4; while ((c & 0x80) != 0) { c = ReadFromInput(); sz += (c & 0x7f) << shift; shift += 7; } switch (typeCode) { case Constants.OBJ_COMMIT: case Constants.OBJ_TREE: case Constants.OBJ_BLOB: case Constants.OBJ_TAG: Whole(typeCode, pos, sz); break; case Constants.OBJ_OFS_DELTA: c = ReadFromInput(); long ofs = c & 127; while ((c & 128) != 0) { ofs += 1; c = ReadFromInput(); ofs <<= 7; ofs += (c & 127); } long pbase = pos - ofs; SkipInflateFromInput(sz); var n = new UnresolvedDelta(pos, (int)_crc.Value); n.Next = _baseByPos.put(pbase, n); _deltaCount++; break; case Constants.OBJ_REF_DELTA: c = FillFromInput(20); _crc.Update(_buffer, c, 20); ObjectId baseId = ObjectId.FromRaw(_buffer, c); Use(20); DeltaChain r = _baseById.Get(baseId); if (r == null) { r = new DeltaChain(baseId); _baseById.Add(r); } SkipInflateFromInput(sz); r.Add(new UnresolvedDelta(pos, (int)_crc.Value)); _deltaCount++; break; default: throw new IOException("Unknown object type " + typeCode + "."); } }
private static UnresolvedDelta Reverse(UnresolvedDelta c) { UnresolvedDelta tail = null; while (c != null) { UnresolvedDelta n = c.Next; c.Next = tail; tail = c; c = n; } return tail; }
public UnresolvedDelta Remove() { UnresolvedDelta r = Head; if (r != null) { Head = null; } return r; }
public void Add(UnresolvedDelta d) { d.Next = Head; Head = d; }
/// <summary> /// Read one entire object or delta from the input. /// </summary> private void IndexOneObject() { long pos = Position(); _crc.Reset(); int c = ReadFromInput(); int typeCode = (c >> 4) & 7; long sz = c & 15; int shift = 4; while ((c & 0x80) != 0) { c = ReadFromInput(); sz += (c & 0x7f) << shift; shift += 7; } switch (typeCode) { case Constants.OBJ_COMMIT: case Constants.OBJ_TREE: case Constants.OBJ_BLOB: case Constants.OBJ_TAG: Whole(typeCode, pos, sz); break; case Constants.OBJ_OFS_DELTA: c = ReadFromInput(); long ofs = c & 127; while ((c & 128) != 0) { ofs += 1; c = ReadFromInput(); ofs <<= 7; ofs += (c & 127); } long pbase = pos - ofs; SkipInflateFromInput(sz); var n = new UnresolvedDelta(pos, (int)_crc.Value); n.Next = _baseByPos.put(pbase, n); _deltaCount++; break; case Constants.OBJ_REF_DELTA: c = FillFromInput(20); _crc.Update(_buffer, c, 20); ObjectId baseId = ObjectId.FromRaw(_buffer, c); Use(20); DeltaChain r = _baseById.Get(baseId); if (r == null) { r = new DeltaChain(baseId); _baseById.Add(r); } SkipInflateFromInput(sz); r.Add(new UnresolvedDelta(pos, (int)_crc.Value)); _deltaCount++; break; default: throw new IOException("Unknown object type " + typeCode + "."); } }
public void Add(UnresolvedDelta d) { d.Next = Head; Head = d; }
private void ResolveChildDeltaChain(int type, byte[] data, UnresolvedDelta a) { while (a != null) { ResolveDeltas(a.Position, a.Crc, type, data, null); a = a.Next; } }