You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

middlewares.go 542B

1234567891011121314151617181920212223
  1. package repo
  2. import (
  3. "fmt"
  4. "github.com/go-gitea/gitea/models"
  5. "github.com/go-gitea/gitea/modules/context"
  6. git "github.com/gogits/git-module"
  7. )
  8. func setEditorconfigIfExists(ctx *context.Context) {
  9. ec, err := ctx.Repo.GetEditorconfig()
  10. if err != nil && !git.IsErrNotExist(err) {
  11. description := fmt.Sprintf("Error while getting .editorconfig file: %v", err)
  12. if err := models.CreateRepositoryNotice(description); err != nil {
  13. ctx.Handle(500, "ErrCreatingReporitoryNotice", err)
  14. }
  15. return
  16. }
  17. ctx.Data["Editorconfig"] = ec
  18. }