diff --git a/routers/web/repo/actions/actions.go b/routers/web/repo/actions/actions.go
index 8a44e836c5..2e3a8976b0 100644
--- a/routers/web/repo/actions/actions.go
+++ b/routers/web/repo/actions/actions.go
@@ -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