func NewReferenceUpdateRequestFromCapabilities(adv *capability.List) *ReferenceUpdateRequest {
	r := NewReferenceUpdateRequest()
	if adv.Supports(capability.Agent) {
		r.Capabilities.Set(capability.Agent, capability.DefaultAgent)
	}
	if adv.Supports(capability.ReportStatus) {
		r.Capabilities.Set(capability.ReportStatus)
	}
	return r
}
NewReferenceUpdateRequestFromCapabilities returns a pointer to a new
ReferenceUpdateRequest value, the request capabilities are filled with the
most optimal ones, based on the adv value (advertised capabilities), the
ReferenceUpdateRequest contains no commands

It does set the following capabilities:
- agent
- report-status
- ofs-delta
- ref-delta
- delete-refs
It leaves up to the user to add the following capabilities later:
- atomic
- ofs-delta
- side-band
- side-band-64k
- quiet
- push-cert
package packp
import (
	"errors"
	"io"
	"gopkg.in/src-d/go-git.v4/plumbing"
	"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/capability"
	"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/sideband"
)
var (
	ErrEmptyCommands    = errors.New("commands cannot be empty")
	ErrMalformedCommand = errors.New("malformed command")
)
type ReferenceUpdateRequest struct {
	Capabilities *capability.List
	Commands     []*Command
	Shallow      *plumbing.Hash
	Packfile io.ReadCloser
	Progress sideband.Progress
}
func NewReferenceUpdateRequest() *ReferenceUpdateRequest {
	return &ReferenceUpdateRequest{
		Capabilities: capability.NewList(),
		Commands:     nil,
	}
}