File: sort.go

package info (click to toggle)
golang-github-go-git-go-git 5.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,648 kB
  • sloc: makefile: 81; sh: 76
file content (14 lines) | stat: -rw-r--r-- 274 bytes parent folder | download
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()
	})
}