From 485dcfb6685f13751f7018bec2e058931b938d39 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 5 Apr 2025 20:23:08 +0800 Subject: misc: Move utils.go's string function to misc --- http_handle_branches.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'http_handle_branches.go') diff --git a/http_handle_branches.go b/http_handle_branches.go index d386b82..01a162a 100644 --- a/http_handle_branches.go +++ b/http_handle_branches.go @@ -10,6 +10,7 @@ import ( "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/storer" + "go.lindenii.runxiyu.org/forge/misc" ) // httpHandleRepoBranches provides the branches page in repos. @@ -24,7 +25,7 @@ func (s *server) httpHandleRepoBranches(writer http.ResponseWriter, _ *http.Requ repo, repoName, groupPath = params["repo"].(*git.Repository), params["repo_name"].(string), params["group_path"].([]string) - if strings.Contains(repoName, "\n") || sliceContainsNewlines(groupPath) { + if strings.Contains(repoName, "\n") || misc.SliceContainsNewlines(groupPath) { notes = append(notes, "Path contains newlines; HTTP Git access impossible") } -- cgit v1.2.3