mirror of https://github.com/gogs/gogs.git
routers/repo: minor code fix for PR #3758
parent
1d951cfc49
commit
2527037973
2
gogs.go
2
gogs.go
|
@ -16,7 +16,7 @@ import (
|
||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.9.130.0131"
|
const APP_VER = "0.9.131.0201"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
setting.AppVer = APP_VER
|
setting.AppVer = APP_VER
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
package repo
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/gogits/git-module"
|
|
||||||
"github.com/gogits/gogs/models"
|
|
||||||
"github.com/gogits/gogs/modules/context"
|
|
||||||
)
|
|
||||||
|
|
||||||
func setEditorconfigIfExists(ctx *context.Context) {
|
|
||||||
ec, err := ctx.Repo.GetEditorconfig()
|
|
||||||
|
|
||||||
if err != nil && !git.IsErrNotExist(err) {
|
|
||||||
description := fmt.Sprintf("Error while getting .editorconfig file: %v", err)
|
|
||||||
if err := models.CreateRepositoryNotice(description); err != nil {
|
|
||||||
ctx.Handle(500, "ErrCreatingReporitoryNotice", err)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.Data["Editorconfig"] = ec
|
|
||||||
}
|
|
|
@ -211,6 +211,15 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setEditorconfigIfExists(ctx *context.Context) {
|
||||||
|
ec, err := ctx.Repo.GetEditorconfig()
|
||||||
|
if err != nil && !git.IsErrNotExist(err) {
|
||||||
|
log.Error(4, "Fail to get '.editorconfig' [%d]: %v", ctx.Repo.Repository.ID, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ctx.Data["Editorconfig"] = ec
|
||||||
|
}
|
||||||
|
|
||||||
func Home(ctx *context.Context) {
|
func Home(ctx *context.Context) {
|
||||||
title := ctx.Repo.Repository.Owner.Name + "/" + ctx.Repo.Repository.Name
|
title := ctx.Repo.Repository.Owner.Name + "/" + ctx.Repo.Repository.Name
|
||||||
if len(ctx.Repo.Repository.Description) > 0 {
|
if len(ctx.Repo.Repository.Description) > 0 {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.9.130.0131
|
0.9.131.0201
|
Loading…
Reference in New Issue