mirror of
https://github.com/go-gitea/gitea
synced 2025-08-13 21:18:21 +00:00
Backport #17598 Backport #17606 Backport #17608 Backport #17609 - Since https://gitea.com/gitea/test-env/pulls/10 the golangci-lint has been upgraded and is erroring about new warnings in the code, this PR fixes those warnings.
This commit is contained in:
@@ -130,14 +130,6 @@ func Recovery() func(next http.Handler) http.Handler {
|
||||
log.Error("%v", combinedErr)
|
||||
|
||||
sessionStore := session.GetSession(req)
|
||||
if sessionStore == nil {
|
||||
if setting.IsProd() {
|
||||
http.Error(w, http.StatusText(500), 500)
|
||||
} else {
|
||||
http.Error(w, combinedErr, 500)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var lc = middleware.Locale(w, req)
|
||||
var store = dataStore{
|
||||
|
@@ -27,7 +27,7 @@ func AdoptOrDeleteRepository(ctx *context.Context) {
|
||||
action := ctx.Query("action")
|
||||
|
||||
ctxUser := ctx.User
|
||||
root := filepath.Join(models.UserPath(ctxUser.LowerName))
|
||||
root := models.UserPath(ctxUser.LowerName)
|
||||
|
||||
// check not a repo
|
||||
has, err := models.IsRepositoryExist(ctxUser, dir)
|
||||
|
@@ -246,7 +246,7 @@ func Repos(ctx *context.Context) {
|
||||
repoNames := make([]string, 0, setting.UI.Admin.UserPagingNum)
|
||||
repos := map[string]*models.Repository{}
|
||||
// We're going to iterate by pagesize.
|
||||
root := filepath.Join(models.UserPath(ctxUser.Name))
|
||||
root := models.UserPath(ctxUser.Name)
|
||||
if err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
|
Reference in New Issue
Block a user