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_repo_index.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_repo_index.go')
-rw-r--r-- | http_handle_repo_index.go | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go index c253fa9..c6338cf 100644 --- a/http_handle_repo_index.go +++ b/http_handle_repo_index.go @@ -5,7 +5,6 @@ package main import ( "net/http" - "strings" "go.lindenii.runxiyu.org/forge/git2c" "go.lindenii.runxiyu.org/forge/render" @@ -26,11 +25,6 @@ func (s *server) httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, p _, repoPath, _, _, _, _, _ := s.getRepoInfo(req.Context(), groupPath, repoName, "") // TODO: Don't use getRepoInfo - var notes []string - if strings.Contains(repoName, "\n") || sliceContainsNewlines(groupPath) { - notes = append(notes, "Path contains newlines; HTTP Git access impossible") - } - client, err := git2c.NewClient(s.config.Git.Socket) if err != nil { errorPage500(w, params, err.Error()) @@ -47,7 +41,6 @@ func (s *server) httpHandleRepoIndex(w http.ResponseWriter, req *http.Request, p params["commits"] = commits params["readme_filename"] = readme.Filename _, params["readme"] = render.Readme(readme.Content, readme.Filename) - params["notes"] = notes renderTemplate(w, "repo_index", params) |