driusan / dgit

A Pure Go Git Implementation
MIT License
112 stars 10 forks source link

Create new delta package #269

Closed driusan closed 4 years ago

driusan commented 4 years ago

Move delta Reader into new package and create delta writing infrastructure

This creates a new package "delta" which is concerned with reading and writing git deltas. The old git.delta type is now a delta.Reader and indexpack is updated accordingly.

The new "delta.Calculate" function takes 2 byte slices and calculates a delta that goes from src to dst, writing the resulting delta to an io.Writer.

PackObjects doesn't yet use it, but this puts the plumbing in place to calculate ref and offset deltas.