forked from forgejo/forgejo
Web editor: improve code quality
This commit is contained in:
parent
67fb0fe6a5
commit
f8a48ffaad
19 changed files with 75 additions and 81 deletions
|
@ -25,9 +25,9 @@ const (
|
|||
|
||||
func RefCommits(ctx *context.Context) {
|
||||
switch {
|
||||
case len(ctx.Repo.TreeName) == 0:
|
||||
case len(ctx.Repo.TreePath) == 0:
|
||||
Commits(ctx)
|
||||
case ctx.Repo.TreeName == "search":
|
||||
case ctx.Repo.TreePath == "search":
|
||||
SearchCommits(ctx)
|
||||
default:
|
||||
FileHistory(ctx)
|
||||
|
@ -104,7 +104,7 @@ func SearchCommits(ctx *context.Context) {
|
|||
func FileHistory(ctx *context.Context) {
|
||||
ctx.Data["IsRepoToolbarCommits"] = true
|
||||
|
||||
fileName := ctx.Repo.TreeName
|
||||
fileName := ctx.Repo.TreePath
|
||||
if len(fileName) == 0 {
|
||||
Commits(ctx)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue