aboutsummaryrefslogtreecommitdiffstats
path: root/internal/reference/sort.go
blob: 726edbdd36042895f4029446d364b6c6c60974af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package reference

import (
	"sort"

	"github.com/go-git/go-git/v5/plumbing"
)

// Sort sorts the references by name to ensure a consistent order.
func Sort(refs []*plumbing.Reference) {
	sort.Slice(refs, func(i, j int) bool {
		return refs[i].Name() < refs[j].Name()
	})
}