mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-31 07:08:06 +08:00
Optimize actions list by removing an unnecessary git
call (#24710)
We already have the default branch so we don't need to make a `git` call to get it.
This commit is contained in:
@ -61,12 +61,7 @@ func List(ctx *context.Context) {
|
||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
} else if !empty {
|
||||
defaultBranch, err := ctx.Repo.GitRepo.GetDefaultBranch()
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
}
|
||||
commit, err := ctx.Repo.GitRepo.GetBranchCommit(defaultBranch)
|
||||
commit, err := ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.Repository.DefaultBranch)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
|
Reference in New Issue
Block a user