mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-27 12:53:57 +01: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:
parent
22da9da0e8
commit
116f8e12a7
1 changed files with 1 additions and 6 deletions
|
@ -61,12 +61,7 @@ func List(ctx *context.Context) {
|
||||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||||
return
|
return
|
||||||
} else if !empty {
|
} else if !empty {
|
||||||
defaultBranch, err := ctx.Repo.GitRepo.GetDefaultBranch()
|
commit, err := ctx.Repo.GitRepo.GetBranchCommit(ctx.Repo.Repository.DefaultBranch)
|
||||||
if err != nil {
|
|
||||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
commit, err := ctx.Repo.GitRepo.GetBranchCommit(defaultBranch)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue