Skip to content

Commit f685554

Browse files
committed
Fix bug
1 parent c171248 commit f685554

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

routers/web/repo/view_file.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ import (
3030
"github.com/nektos/act/pkg/model"
3131
)
3232

33-
func prepareLatestCommitInfo(ctx *context.Context) {
33+
func prepareLatestCommitInfo(ctx *context.Context) bool {
3434
commit, err := ctx.Repo.Commit.GetCommitByPath(ctx.Repo.TreePath)
3535
if err != nil {
3636
ctx.ServerError("GetCommitByPath", err)
37-
return
37+
return false
3838
}
3939

40-
if !loadLatestCommitData(ctx, commit) {
41-
return
42-
}
40+
return loadLatestCommitData(ctx, commit)
4341
}
4442

4543
func prepareToRenderFile(ctx *context.Context, entry *git.TreeEntry) {
4644
ctx.Data["IsViewFile"] = true
4745
ctx.Data["HideRepoInfo"] = true
4846

49-
prepareLatestCommitInfo(ctx)
47+
if !prepareLatestCommitInfo(ctx) {
48+
return
49+
}
5050

5151
// Don't call any other repository functions until the dataRc closed to
5252
// avoid create unnecessary temporary cat file.

0 commit comments

Comments
 (0)