diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:52:04 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:52:04 +0800 |
commit | b4b0d966340ad9c892f8b8912eebc6118eed7482 (patch) | |
tree | 0512a6dd5cfc21fbd91a07d31f972aa2a1cf844d /http_handle_repo_upload_pack.go | |
parent | git2c: git2c.go -> client.go, a more sensible name (diff) | |
download | forge-b4b0d966340ad9c892f8b8912eebc6118eed7482.tar.gz forge-b4b0d966340ad9c892f8b8912eebc6118eed7482.tar.zst forge-b4b0d966340ad9c892f8b8912eebc6118eed7482.zip |
Use cmd/forge for the entry point
Diffstat (limited to 'http_handle_repo_upload_pack.go')
-rw-r--r-- | http_handle_repo_upload_pack.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/http_handle_repo_upload_pack.go b/http_handle_repo_upload_pack.go index a6580a7..4c7291b 100644 --- a/http_handle_repo_upload_pack.go +++ b/http_handle_repo_upload_pack.go @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org> -package main +package forge import ( "io" @@ -14,7 +14,7 @@ import ( // httpHandleUploadPack handles incoming Git fetch/pull/clone's over the Smart // HTTP protocol. -func (s *server) httpHandleUploadPack(writer http.ResponseWriter, request *http.Request, params map[string]any) (err error) { +func (s *Server) httpHandleUploadPack(writer http.ResponseWriter, request *http.Request, params map[string]any) (err error) { var groupPath []string var repoName string var repoPath string @@ -24,7 +24,7 @@ func (s *server) httpHandleUploadPack(writer http.ResponseWriter, request *http. groupPath, repoName = params["group_path"].([]string), params["repo_name"].(string) - if err := s.database.QueryRow(request.Context(), ` + if err := s.Database.QueryRow(request.Context(), ` WITH RECURSIVE group_path_cte AS ( -- Start: match the first name in the path where parent_group IS NULL SELECT @@ -67,7 +67,7 @@ func (s *server) httpHandleUploadPack(writer http.ResponseWriter, request *http. writer.WriteHeader(http.StatusOK) cmd = exec.Command("git", "upload-pack", "--stateless-rpc", repoPath) - cmd.Env = append(os.Environ(), "LINDENII_FORGE_HOOKS_SOCKET_PATH="+s.config.Hooks.Socket) + cmd.Env = append(os.Environ(), "LINDENII_FORGE_HOOKS_SOCKET_PATH="+s.Config.Hooks.Socket) if stdout, err = cmd.StdoutPipe(); err != nil { return err } |