func (a *AdvRefs) Encode(w io.Writer) error {
	e := newAdvRefsEncoder(w)
	return e.Encode(a)
}
Encode writes the AdvRefs encoding to a writer.

All the payloads will end with a newline character. Capabilities,
references and shallows are written in alphabetical order, except for
peeled references that always follow their corresponding references.
package packp
import (
	"bytes"
	"fmt"
	"io"
	"sort"
	"gopkg.in/src-d/go-git.v4/plumbing"
	"gopkg.in/src-d/go-git.v4/plumbing/format/pktline"
	"gopkg.in/src-d/go-git.v4/plumbing/protocol/packp/capability"
)