From ce0b76e7674d683db547103bc773305129a0ded4 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Sun, 29 Oct 2023 16:35:09 -0400 Subject: git: implement upload-server-info. Fixes #731 This adds UpdateServerInfo along with a new go-git command to generate info files to help git dumb http serve refs and their objects. This also updates the docs to reflect this. Docs: https://git-scm.com/docs/git-update-server-info Fixes: https://github.com/go-git/go-git/issues/731 --- internal/reference/sort.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 internal/reference/sort.go (limited to 'internal/reference') diff --git a/internal/reference/sort.go b/internal/reference/sort.go new file mode 100644 index 0000000..726edbd --- /dev/null +++ b/internal/reference/sort.go @@ -0,0 +1,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() + }) +} -- cgit