RefService.ListRefs: implement sort options
The first implementation of ListRefs
(for #90 (closed)) will be the minimal one for gitaly-backups
, which does not use the the sort options.
Here is the only occurence of ListRefsRequest
in Gitaly's code base as of GitLab 14.8, outside of the service implementation and code generated from protocol (internal/backup/backup.go
):
// listRefs fetches the full set of refs and targets for the repository
func (mgr *Manager) listRefs(ctx context.Context, server storage.ServerInfo, repo *gitalypb.Repository) ([]*gitalypb.ListRefsResponse_Reference, error) {
refClient, err := mgr.newRefClient(ctx, server)
if err != nil {
return nil, fmt.Errorf("list refs: %w", err)
}
stream, err := refClient.ListRefs(ctx, &gitalypb.ListRefsRequest{
Repository: repo,
Head: true,
Patterns: [][]byte{[]byte("refs/")},
})