From ddc1de2fb25fda748d8d3a614b697e7f24c83eb7 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 06 Mar 2025 20:19:38 +0800 Subject: [PATCH] *: Reformat --- git_misc.go | 2 +- http_handle_group_index.go | 1 - http_handle_repo_upload_pack.go | 1 - http_server.go | 4 ++-- diff --git a/git_misc.go b/git_misc.go index e80c737b2f86f38adf3169aa281f70d2a90b62e1..f2f8dba40ace4df3b4f4270d372d124e7cf79666 100644 --- a/git_misc.go +++ b/git_misc.go @@ -10,10 +10,10 @@ "io" "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 bbdff469dc52150729527dcfec9f772aaf6e7b3d..429532c0206b7a766ea8ca8f69ac13ec489e9afe 100644 --- a/http_handle_group_index.go +++ b/http_handle_group_index.go @@ -127,4 +127,3 @@ fmt.Println(group_path) render_template(w, "group", params) } - diff --git a/http_handle_repo_upload_pack.go b/http_handle_repo_upload_pack.go index 4d3ec0987f89a9153422b4ad5db44bd70b2ca1e0..04ffe57eaab5f153e10b43dd53a79554e8179c41 100644 --- a/http_handle_repo_upload_pack.go +++ b/http_handle_repo_upload_pack.go @@ -59,7 +59,6 @@ ).Scan(&repo_path); err != nil { 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 7790d1f88889ffd16d2c50b933c8737408e6ab51..199a3c5e38c58494ce9857bc706e56195f3bcc5e 100644 --- a/http_server.go +++ b/http_server.go @@ -100,7 +100,7 @@ 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 @@ fmt.Println(non_empty_last_segments_len, separator_index, segments) if non_empty_last_segments_len == separator_index+3 { if redirect_with_slash(w, r) { - return + return } handle_repo_index(w, r, params) return -- 2.48.1