aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-10 15:25:01 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-10 15:25:01 +0800
commit2aec67cda504418d17ea2700882497565d1393d2 (patch)
treecdc6f1e691099e8faa0954f5c49feb2c67233374
parentrepo_tree: Attempt to use the autumn theme (diff)
downloadforge-2aec67cda504418d17ea2700882497565d1393d2.tar.gz
forge-2aec67cda504418d17ea2700882497565d1393d2.tar.zst
forge-2aec67cda504418d17ea2700882497565d1393d2.zip
repo_tree: Remove unnecessary commit_iter code
-rw-r--r--handle_repo_tree.go17
1 files changed, 0 insertions, 17 deletions
diff --git a/handle_repo_tree.go b/handle_repo_tree.go
index af4d2be..5a66df6 100644
--- a/handle_repo_tree.go
+++ b/handle_repo_tree.go
@@ -11,7 +11,6 @@ import (
chroma_lexers "github.com/alecthomas/chroma/v2/lexers"
chroma_styles "github.com/alecthomas/chroma/v2/styles"
"github.com/go-git/go-git/v5"
- "github.com/go-git/go-git/v5/plumbing/object"
"github.com/microcosm-cc/bluemonday"
"github.com/yuin/goldmark"
)
@@ -32,22 +31,6 @@ func handle_repo_tree(w http.ResponseWriter, r *http.Request) {
return
}
head_hash := head.Hash()
- commit_iter, err := repo.Log(&git.LogOptions{From: head_hash})
- if err != nil {
- _, _ = w.Write([]byte("Error getting repo commits: " + err.Error()))
- return
- }
- recent_commits := make([]*object.Commit, 0)
- defer commit_iter.Close()
- for range 3 {
- this_recent_commit, err := commit_iter.Next()
- if err != nil {
- _, _ = w.Write([]byte("Error getting a recent commit: " + err.Error()))
- return
- }
- recent_commits = append(recent_commits, this_recent_commit)
- }
- data["commits"] = recent_commits
commit_object, err := repo.CommitObject(head_hash)
if err != nil {
_, _ = w.Write([]byte("Error getting commit object: " + err.Error()))