1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-10 11:38:20 +00:00

Fix various bugs (1.24) (#35186)

Backport #35177, #35183
This commit is contained in:
wxiaoguang
2025-07-31 12:04:47 +08:00
committed by GitHub
parent d05cf08fad
commit 9162f4403a
17 changed files with 124 additions and 69 deletions

View File

@@ -8,6 +8,7 @@ import (
"time"
"code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/services/context"
"github.com/gorilla/feeds"
@@ -15,10 +16,14 @@ import (
// ShowBranchFeed shows tags and/or releases on the repo as RSS / Atom feed
func ShowBranchFeed(ctx *context.Context, repo *repo.Repository, formatType string) {
commits, err := ctx.Repo.Commit.CommitsByRange(0, 10, "")
if err != nil {
ctx.ServerError("ShowBranchFeed", err)
return
var commits []*git.Commit
var err error
if ctx.Repo.Commit != nil {
commits, err = ctx.Repo.Commit.CommitsByRange(0, 10, "")
if err != nil {
ctx.ServerError("ShowBranchFeed", err)
return
}
}
title := "Latest commits for branch " + ctx.Repo.BranchName