aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-06 20:19:38 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-06 20:19:38 +0800
commitddc1de2fb25fda748d8d3a614b697e7f24c83eb7 (patch)
treefcba63ebed04caa7db504017cf82229df8e88b90
parent*: Bump go-git (diff)
downloadforge-ddc1de2fb25fda748d8d3a614b697e7f24c83eb7.tar.gz
forge-ddc1de2fb25fda748d8d3a614b697e7f24c83eb7.tar.zst
forge-ddc1de2fb25fda748d8d3a614b697e7f24c83eb7.zip
*: Reformat
Diffstat (limited to '')
-rw-r--r--git_misc.go2
-rw-r--r--http_handle_group_index.go1
-rw-r--r--http_handle_repo_upload_pack.go1
-rw-r--r--http_server.go4
4 files changed, 3 insertions, 5 deletions
diff --git a/git_misc.go b/git_misc.go
index e80c737..f2f8dba 100644
--- a/git_misc.go
+++ b/git_misc.go
@@ -10,10 +10,10 @@ import (
"os"
"strings"
- "github.com/jackc/pgx/v5/pgtype"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
+ "github.com/jackc/pgx/v5/pgtype"
)
// open_git_repo opens a git repository by group and repo name.
diff --git a/http_handle_group_index.go b/http_handle_group_index.go
index bbdff46..429532c 100644
--- a/http_handle_group_index.go
+++ b/http_handle_group_index.go
@@ -127,4 +127,3 @@ func handle_group_index(w http.ResponseWriter, r *http.Request, params map[strin
render_template(w, "group", params)
}
-
diff --git a/http_handle_repo_upload_pack.go b/http_handle_repo_upload_pack.go
index 4d3ec09..04ffe57 100644
--- a/http_handle_repo_upload_pack.go
+++ b/http_handle_repo_upload_pack.go
@@ -59,7 +59,6 @@ func handle_upload_pack(w http.ResponseWriter, r *http.Request, params map[strin
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")
diff --git a/http_server.go b/http_server.go
index 7790d1f..199a3c5 100644
--- a/http_server.go
+++ b/http_server.go
@@ -100,7 +100,7 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if separator_index > 0 {
group_path = segments[:separator_index]
} else {
- group_path = segments[:len(segments) - 1]
+ group_path = segments[:len(segments)-1]
}
params["group_path"] = group_path
@@ -160,7 +160,7 @@ func (router *http_router_t) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if non_empty_last_segments_len == separator_index+3 {
if redirect_with_slash(w, r) {
- return
+ return
}
handle_repo_index(w, r, params)
return