fix lint & co

This commit is contained in:
6543 2023-03-30 23:31:15 +02:00
parent 794e497f21
commit ff0bc0f0ae
2 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,5 @@
//go:build integration
// +build integration
package integration

View File

@ -68,8 +68,8 @@ func (o *Options) matchRedirects(ctx *context.Context, giteaClient *gitea.Client
for _, redirect := range redirects {
reqUrl := ctx.Req.RequestURI
// remove repo and branch from request url
reqUrl = strings.TrimPrefix(reqUrl, "/" + o.TargetRepo)
reqUrl = strings.TrimPrefix(reqUrl, "/@" + o.TargetBranch)
reqUrl = strings.TrimPrefix(reqUrl, "/"+o.TargetRepo)
reqUrl = strings.TrimPrefix(reqUrl, "/@"+o.TargetBranch)
// check if from url matches request url
if strings.TrimSuffix(redirect.From, "/") == strings.TrimSuffix(reqUrl, "/") {
@ -112,6 +112,6 @@ func (o *Options) matchRedirects(ctx *context.Context, giteaClient *gitea.Client
}
}
}
return false
}
}