func UpdateObjectStorage(s storer.EncodedObjectStorer, packfile io.Reader) error {
	if sw, ok := s.(storer.PackfileWriter); ok {
		return writePackfileToObjectStorage(sw, packfile)
	}
	stream := NewScanner(packfile)
	d, err := NewDecoder(stream, s)
	if err != nil {
		return err
	}
	_, err = d.Decode()
	return err
}
UpdateObjectStorage updates the given storer.EncodedObjectStorer with the contents of the
packfile.
package packfile
import (
	"bytes"
	"io"
	"sync"
	"gopkg.in/src-d/go-git.v4/plumbing/storer"
	"gopkg.in/src-d/go-git.v4/utils/ioutil"
)
var signature = []byte{'P', 'A', 'C', 'K'}
const (
	VersionSupported uint32 = 2
	firstLengthBits = uint8(4)    
	lengthBits      = uint8(7)    
	maskFirstLength = 15          
	maskContinue    = 0x80        
	maskLength      = uint8(127)  
	maskType        = uint8(112)  
)