diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:21:32 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:21:32 +0800 |
commit | 71ab9b7f14118f02dd18cd733bd4e0ad19ece590 (patch) | |
tree | 0303cbee651a4e1cee62a348d25066b9543f4425 /http_handle_repo_tree.go | |
parent | git2d: Remove UTF-8 checks (diff) | |
download | forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.gz forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.zst forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.zip |
config shall no longer be a global variable
Diffstat (limited to 'http_handle_repo_tree.go')
-rw-r--r-- | http_handle_repo_tree.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/http_handle_repo_tree.go b/http_handle_repo_tree.go index 9cdd9cd..7af6e3e 100644 --- a/http_handle_repo_tree.go +++ b/http_handle_repo_tree.go @@ -16,16 +16,16 @@ import ( // individual files, and provides directory views that link to these files. // // TODO: Do not highlight files that are too large. -func httpHandleRepoTree(writer http.ResponseWriter, request *http.Request, params map[string]any) { +func (s *server) httpHandleRepoTree(writer http.ResponseWriter, request *http.Request, params map[string]any) { repoName := params["repo_name"].(string) groupPath := params["group_path"].([]string) rawPathSpec := params["rest"].(string) pathSpec := strings.TrimSuffix(rawPathSpec, "/") params["path_spec"] = pathSpec - _, repoPath, _, _, _, _, _ := getRepoInfo(request.Context(), groupPath, repoName, "") + _, repoPath, _, _, _, _, _ := s.getRepoInfo(request.Context(), groupPath, repoName, "") - client, err := git2c.NewClient(config.Git.Socket) + client, err := git2c.NewClient(s.config.Git.Socket) if err != nil { errorPage500(writer, params, err.Error()) return |