code: func NewEncoder(w io.Writer, s storer.EncodedObjectStorer, useRefDeltas bool) *Encoder {
  	h := plumbing.Hasher{
  		Hash: sha1.New(),
  	}
  	mw := io.MultiWriter(w, h)
  	ow := newOffsetWriter(mw)
  	zw := zlib.NewWriter(mw)
  	return &Encoder{
  		selector:     newDeltaSelector(s),
  		w:            ow,
  		zw:           zw,
  		hasher:       h,
  		useRefDeltas: useRefDeltas,
  	}
  }
docs: // NewEncoder creates a new packfile encoder using a specific Writer and
  // EncodedObjectStorer. By default deltas used to generate the packfile will be
  // OFSDeltaObject. To use Reference deltas, set useRefDeltas to true.