aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-03 16:07:41 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-03 16:07:41 +0800
commitb8f51b14f28a9fe09f30fb41d140a093c20d7160 (patch)
tree6a91b4c1b952114b7694b978f7ce0b9924d2d669
parentHTTP: Make README rendering more composable (diff)
downloadforge-b8f51b14f28a9fe09f30fb41d140a093c20d7160.tar.gz
forge-b8f51b14f28a9fe09f30fb41d140a093c20d7160.tar.zst
forge-b8f51b14f28a9fe09f30fb41d140a093c20d7160.zip
Rename commitDisplay to commitDisplayOld
-rw-r--r--cache_index_commits_display.go4
-rw-r--r--git_misc.go10
-rw-r--r--http_handle_repo_index.go2
3 files changed, 8 insertions, 8 deletions
diff --git a/cache_index_commits_display.go b/cache_index_commits_display.go
index fc28cf1..54b3eab 100644
--- a/cache_index_commits_display.go
+++ b/cache_index_commits_display.go
@@ -9,11 +9,11 @@ import (
)
// The key is the commit ID raw hash.
-var indexCommitsDisplayCache *ristretto.Cache[[]byte, []commitDisplay]
+var indexCommitsDisplayCache *ristretto.Cache[[]byte, []commitDisplayOld]
func init() {
var err error
- indexCommitsDisplayCache, err = ristretto.NewCache(&ristretto.Config[[]byte, []commitDisplay]{
+ indexCommitsDisplayCache, err = ristretto.NewCache(&ristretto.Config[[]byte, []commitDisplayOld]{
NumCounters: 1e4,
MaxCost: 1 << 60,
BufferItems: 8192,
diff --git a/git_misc.go b/git_misc.go
index 3ff6f81..4714e1a 100644
--- a/git_misc.go
+++ b/git_misc.go
@@ -165,7 +165,7 @@ func getRecentCommits(repo *git.Repository, headHash plumbing.Hash, numCommits i
// getRecentCommitsDisplay generates a slice of [commitDisplay] friendly for
// use in HTML templates, consisting of numCommits commits from headhash in the
// repo.
-func getRecentCommitsDisplay(repo *git.Repository, headHash plumbing.Hash, numCommits int) (recentCommits []commitDisplay, err error) {
+func getRecentCommitsDisplay(repo *git.Repository, headHash plumbing.Hash, numCommits int) (recentCommits []commitDisplayOld, err error) {
var commitIter object.CommitIter
var thisCommit *object.Commit
@@ -173,7 +173,7 @@ func getRecentCommitsDisplay(repo *git.Repository, headHash plumbing.Hash, numCo
if err != nil {
return nil, err
}
- recentCommits = make([]commitDisplay, 0)
+ recentCommits = make([]commitDisplayOld, 0)
defer commitIter.Close()
if numCommits < 0 {
for {
@@ -183,7 +183,7 @@ func getRecentCommitsDisplay(repo *git.Repository, headHash plumbing.Hash, numCo
} else if err != nil {
return nil, err
}
- recentCommits = append(recentCommits, commitDisplay{
+ recentCommits = append(recentCommits, commitDisplayOld{
thisCommit.Hash,
thisCommit.Author,
thisCommit.Committer,
@@ -199,7 +199,7 @@ func getRecentCommitsDisplay(repo *git.Repository, headHash plumbing.Hash, numCo
} else if err != nil {
return nil, err
}
- recentCommits = append(recentCommits, commitDisplay{
+ recentCommits = append(recentCommits, commitDisplayOld{
thisCommit.Hash,
thisCommit.Author,
thisCommit.Committer,
@@ -211,7 +211,7 @@ func getRecentCommitsDisplay(repo *git.Repository, headHash plumbing.Hash, numCo
return recentCommits, err
}
-type commitDisplay struct {
+type commitDisplayOld struct {
Hash plumbing.Hash
Author object.Signature
Committer object.Signature
diff --git a/http_handle_repo_index.go b/http_handle_repo_index.go
index 9dc3ea6..6852fe7 100644
--- a/http_handle_repo_index.go
+++ b/http_handle_repo_index.go
@@ -27,7 +27,7 @@ func httpHandleRepoIndex(writer http.ResponseWriter, _ *http.Request, params map
var notes []string
var branches []string
var branchesIter storer.ReferenceIter
- var commits []commitDisplay
+ var commits []commitDisplayOld
repo, repoName, groupPath = params["repo"].(*git.Repository), params["repo_name"].(string), params["group_path"].([]string)