diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:23:08 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:23:08 +0800 |
commit | 485dcfb6685f13751f7018bec2e058931b938d39 (patch) | |
tree | c9fe357b9a8c2f8853141828443ad1680022781b /http_handle_branches.go | |
parent | config shall no longer be a global variable (diff) | |
download | forge-485dcfb6685f13751f7018bec2e058931b938d39.tar.gz forge-485dcfb6685f13751f7018bec2e058931b938d39.tar.zst forge-485dcfb6685f13751f7018bec2e058931b938d39.zip |
misc: Move utils.go's string function to misc
Diffstat (limited to 'http_handle_branches.go')
-rw-r--r-- | http_handle_branches.go | 3 |
1 files changed, 2 insertions, 1 deletions
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") } |