Skip to content

Commit

Permalink
Optimize actions list by removing an unnecessary git call (#24710)
Browse files Browse the repository at this point in the history
We already have the default branch so we don't need to make a `git` call
to get it.
  • Loading branch information
yardenshoham authored May 14, 2023
1 parent 22da9da commit 116f8e1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions routers/web/repo/actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 116f8e1

Please sign in to comment.