Example #1
0
// RepackBlobs reads all blobs in blobIDs from src and saves them into new pack
// files in dst. Source and destination repo may be the same.
func RepackBlobs(src, dst *repository.Repository, blobIDs backend.IDSet) (err error) {
	for id := range blobIDs {
		err = repackBlob(src, dst, id)
		if err != nil {
			return err
		}
	}

	err = dst.Flush()
	if err != nil {
		return err
	}

	return nil
}