diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-02 02:44:45 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-02 02:44:45 +0800 |
commit | cb59a7ad40c86f3ce3ce8fd7b838e9e09634a361 (patch) | |
tree | ac74826db87cb66c9b980fa668b7f69c740edd27 | |
parent | LMTP: Add an SMTP request context (diff) | |
download | forge-cb59a7ad40c86f3ce3ce8fd7b838e9e09634a361.tar.gz forge-cb59a7ad40c86f3ce3ce8fd7b838e9e09634a361.tar.zst forge-cb59a7ad40c86f3ce3ce8fd7b838e9e09634a361.zip |
Git: Return fsPath from OpenRepo
-rw-r--r-- | git_misc.go | 4 | ||||
-rw-r--r-- | http_server.go | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/git_misc.go b/git_misc.go index a8d7c30..3ff6f81 100644 --- a/git_misc.go +++ b/git_misc.go @@ -22,9 +22,7 @@ import ( // TODO: This should be deprecated in favor of doing it in the relevant // request/router context in the future, as it cannot cover the nuance of // fields needed. -func openRepo(ctx context.Context, groupPath []string, repoName string) (repo *git.Repository, description string, repoID int, err error) { - var fsPath string - +func openRepo(ctx context.Context, groupPath []string, repoName string) (repo *git.Repository, description string, repoID int, fsPath string, err error) { err = database.QueryRow(ctx, ` WITH RECURSIVE group_path_cte AS ( -- Start: match the first name in the path where parent_group IS NULL diff --git a/http_server.go b/http_server.go index 8931853..739c0aa 100644 --- a/http_server.go +++ b/http_server.go @@ -181,7 +181,7 @@ func (router *forgeHTTPRouter) ServeHTTP(writer http.ResponseWriter, request *ht // TODO: subgroups - if params["repo"], params["repo_description"], params["repo_id"], err = openRepo(request.Context(), groupPath, moduleName); err != nil { + if params["repo"], params["repo_description"], params["repo_id"], _, err = openRepo(request.Context(), groupPath, moduleName); err != nil { errorPage500(writer, params, "Error opening repo: "+err.Error()) return } |