From cfc8bd2bd3930fc91847a71a8d0092c2c85b0f4a Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 13 Feb 2025 09:19:54 +0800 Subject: repo_index: Add repo descriptions --- http_handle_repo_commit.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'http_handle_repo_commit.go') diff --git a/http_handle_repo_commit.go b/http_handle_repo_commit.go index 1a84862..7469448 100644 --- a/http_handle_repo_commit.go +++ b/http_handle_repo_commit.go @@ -19,11 +19,12 @@ type usable_file_patch struct { func handle_repo_commit(w http.ResponseWriter, r *http.Request, params map[string]any) { group_name, repo_name, commit_id_specified_string := params["group_name"].(string), params["repo_name"].(string), params["commit_id"].(string) - repo, err := open_git_repo(r.Context(), group_name, repo_name) + repo, description, err := open_git_repo(r.Context(), group_name, repo_name) if err != nil { fmt.Fprintln(w, "Error opening repo:", err.Error()) return } + params["repo_description"] = description commit_id_specified_string_without_suffix := strings.TrimSuffix(commit_id_specified_string, ".patch") commit_id := plumbing.NewHash(commit_id_specified_string_without_suffix) commit_object, err := repo.CommitObject(commit_id) -- cgit v1.2.3