1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-31 22:58:35 +00:00

Fix various bugs (#35177)

* Fix #35144
* Fix #35117
* Fix https://github.com/go-gitea/gitea/issues/35054#issuecomment-3131793977
* Fix #35136
This commit is contained in:
wxiaoguang
2025-07-30 15:08:59 +08:00
committed by GitHub
parent b7d8fade72
commit 85b5877bb0
11 changed files with 84 additions and 33 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