aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_upload_pack.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-22 13:44:03 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-22 13:44:03 +0800
commit99fd8a9cf96a51fcd9e50445cb035cc9ecd012de (patch)
tree077812874d2650216549048524886059391b5d45 /http_handle_repo_upload_pack.go
parentInitial linting (diff)
downloadforge-99fd8a9cf96a51fcd9e50445cb035cc9ecd012de.tar.gz
forge-99fd8a9cf96a51fcd9e50445cb035cc9ecd012de.tar.zst
forge-99fd8a9cf96a51fcd9e50445cb035cc9ecd012de.zip
Variable name lengths
Diffstat (limited to 'http_handle_repo_upload_pack.go')
-rw-r--r--http_handle_repo_upload_pack.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/http_handle_repo_upload_pack.go b/http_handle_repo_upload_pack.go
index a88297d..a5a0036 100644
--- a/http_handle_repo_upload_pack.go
+++ b/http_handle_repo_upload_pack.go
@@ -12,7 +12,7 @@ import (
"github.com/jackc/pgx/v5/pgtype"
)
-func httpHandleUploadPack(w http.ResponseWriter, r *http.Request, params map[string]any) (err error) {
+func httpHandleUploadPack(writer http.ResponseWriter, request *http.Request, params map[string]any) (err error) {
var groupPath []string
var repoName string
var repoPath string
@@ -22,7 +22,7 @@ func httpHandleUploadPack(w http.ResponseWriter, r *http.Request, params map[str
groupPath, repoName = params["group_path"].([]string), params["repo_name"].(string)
- if err := database.QueryRow(r.Context(), `
+ if err := database.QueryRow(request.Context(), `
WITH RECURSIVE group_path_cte AS (
-- Start: match the first name in the path where parent_group IS NULL
SELECT
@@ -59,10 +59,10 @@ func httpHandleUploadPack(w http.ResponseWriter, r *http.Request, params map[str
return err
}
- w.Header().Set("Content-Type", "application/x-git-upload-pack-result")
- w.Header().Set("Connection", "Keep-Alive")
- w.Header().Set("Transfer-Encoding", "chunked")
- w.WriteHeader(http.StatusOK)
+ writer.Header().Set("Content-Type", "application/x-git-upload-pack-result")
+ writer.Header().Set("Connection", "Keep-Alive")
+ writer.Header().Set("Transfer-Encoding", "chunked")
+ writer.WriteHeader(http.StatusOK)
cmd = exec.Command("git", "upload-pack", "--stateless-rpc", repoPath)
cmd.Env = append(os.Environ(), "LINDENII_FORGE_HOOKS_SOCKET_PATH="+config.Hooks.Socket)
@@ -85,7 +85,7 @@ func httpHandleUploadPack(w http.ResponseWriter, r *http.Request, params map[str
return err
}
- if _, err = io.Copy(stdin, r.Body); err != nil {
+ if _, err = io.Copy(stdin, request.Body); err != nil {
return err
}
@@ -93,7 +93,7 @@ func httpHandleUploadPack(w http.ResponseWriter, r *http.Request, params map[str
return err
}
- if _, err = io.Copy(w, stdout); err != nil {
+ if _, err = io.Copy(writer, stdout); err != nil {
return err
}