aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_log.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-06 01:55:21 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-06 02:08:58 +0800
commitfaa5ca8fab23176d390e9522f1485d467851545b (patch)
treed3b1d081e0ea5e7f71a94dc1d301e2540a8abcc8 /http_handle_repo_log.go
parentSlight refactor on NewServer (diff)
downloadforge-0.1.28.tar.gz
forge-0.1.28.tar.zst
forge-0.1.28.zip
Move stuff into internal/unsortedv0.1.28
Diffstat (limited to 'http_handle_repo_log.go')
-rw-r--r--http_handle_repo_log.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/http_handle_repo_log.go b/http_handle_repo_log.go
deleted file mode 100644
index fbc7478..0000000
--- a/http_handle_repo_log.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-only
-// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>
-
-package forge
-
-import (
- "net/http"
-
- "github.com/go-git/go-git/v5"
- "github.com/go-git/go-git/v5/plumbing"
- "go.lindenii.runxiyu.org/forge/internal/web"
-)
-
-// httpHandleRepoLog provides a page with a complete Git log.
-//
-// TODO: This currently provides all commits in the branch. It should be
-// paginated and cached instead.
-func (s *Server) httpHandleRepoLog(writer http.ResponseWriter, _ *http.Request, params map[string]any) {
- var repo *git.Repository
- var refHash plumbing.Hash
- var err error
-
- repo = params["repo"].(*git.Repository)
-
- if refHash, err = getRefHash(repo, params["ref_type"].(string), params["ref_name"].(string)); err != nil {
- web.ErrorPage500(s.templates, writer, params, "Error getting ref hash: "+err.Error())
- return
- }
-
- logOptions := git.LogOptions{From: refHash} //exhaustruct:ignore
- commitIter, err := repo.Log(&logOptions)
- if err != nil {
- web.ErrorPage500(s.templates, writer, params, "Error getting recent commits: "+err.Error())
- return
- }
- params["commits"], params["commits_err"] = commitIterSeqErr(commitIter)
-
- s.renderTemplate(writer, "repo_log", params)
-}