aboutsummaryrefslogtreecommitdiff
path: root/http_handle_group_index.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
commit71ab9b7f14118f02dd18cd733bd4e0ad19ece590 (patch)
tree0303cbee651a4e1cee62a348d25066b9543f4425 /http_handle_group_index.go
parentgit2d: Remove UTF-8 checks (diff)
downloadforge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.gz
forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.zst
forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.zip
config shall no longer be a global variable
Diffstat (limited to 'http_handle_group_index.go')
-rw-r--r--http_handle_group_index.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/http_handle_group_index.go b/http_handle_group_index.go
index 568a38e..16120a8 100644
--- a/http_handle_group_index.go
+++ b/http_handle_group_index.go
@@ -17,7 +17,7 @@ import (
// httpHandleGroupIndex provides index pages for groups, which includes a list
// of its subgroups and repos, as well as a form for group maintainers to
// create repos.
-func httpHandleGroupIndex(writer http.ResponseWriter, request *http.Request, params map[string]any) {
+func (s *server) httpHandleGroupIndex(writer http.ResponseWriter, request *http.Request, params map[string]any) {
var groupPath []string
var repos []nameDesc
var subgroups []nameDesc
@@ -111,7 +111,7 @@ func httpHandleGroupIndex(writer http.ResponseWriter, request *http.Request, par
return
}
- filePath := filepath.Join(config.Git.RepoDir, strconv.Itoa(newRepoID)+".git")
+ filePath := filepath.Join(s.config.Git.RepoDir, strconv.Itoa(newRepoID)+".git")
_, err = database.Exec(
request.Context(),
@@ -126,7 +126,7 @@ func httpHandleGroupIndex(writer http.ResponseWriter, request *http.Request, par
return
}
- if err = gitInit(filePath); err != nil {
+ if err = s.gitInit(filePath); err != nil {
errorPage500(writer, params, "Error initializing repo: "+err.Error())
return
}