Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions modules/actions/workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,6 @@ func matchPullRequestReviewEvent(prPayload *api.PullRequestPayload, evt *jobpars
for _, val := range vals {
if slices.ContainsFunc(actions, glob.MustCompile(val, '/').Match) {
matched = true
}
if matched {
break
}
}
Expand Down Expand Up @@ -615,8 +613,6 @@ func matchPullRequestReviewCommentEvent(prPayload *api.PullRequestPayload, evt *
for _, val := range vals {
if slices.ContainsFunc(actions, glob.MustCompile(val, '/').Match) {
matched = true
}
if matched {
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/setting/markup.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func loadMarkupFrom(rootCfg ConfigProvider) {
func newMarkupSanitizer(name string, sec ConfigSection) {
rule, ok := createMarkupSanitizerRule(name, sec)
if ok {
if after, ok0 := strings.CutPrefix(name, "sanitizer."); ok0 {
if after, found := strings.CutPrefix(name, "sanitizer."); found {
names := strings.SplitN(after, ".", 2)
name = names[0]
}
Expand Down
6 changes: 1 addition & 5 deletions routers/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ func Install(ctx *context.Context) {
form.SSLMode = setting.Database.SSLMode

curDBType := setting.Database.Type.String()
var isCurDBTypeSupported bool
if slices.Contains(setting.SupportedDatabaseTypes, curDBType) {
isCurDBTypeSupported = true
}
if !isCurDBTypeSupported {
if !slices.Contains(setting.SupportedDatabaseTypes, curDBType) {
curDBType = "mysql"
}
ctx.Data["CurDbType"] = curDBType
Expand Down
6 changes: 1 addition & 5 deletions routers/web/explore/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ func Code(ctx *context.Context) {

loadRepoIDs := make([]int64, 0, len(searchResults))
for _, result := range searchResults {
var find bool
if slices.Contains(loadRepoIDs, result.RepoID) {
find = true
}
if !find {
if !slices.Contains(loadRepoIDs, result.RepoID) {
loadRepoIDs = append(loadRepoIDs, result.RepoID)
}
}
Expand Down
6 changes: 1 addition & 5 deletions routers/web/user/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ func CodeSearch(ctx *context.Context) {

loadRepoIDs := make([]int64, 0, len(searchResults))
for _, result := range searchResults {
var find bool
if slices.Contains(loadRepoIDs, result.RepoID) {
find = true
}
if !find {
if !slices.Contains(loadRepoIDs, result.RepoID) {
loadRepoIDs = append(loadRepoIDs, result.RepoID)
}
}
Expand Down
8 changes: 2 additions & 6 deletions tests/integration/api_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,7 @@ func TestAPISearchIssues(t *testing.T) {
defer tests.PrepareTestEnv(t)()

// as this API was used in the frontend, it uses UI page size
expectedIssueCount := min(
// from the fixtures
20, setting.UI.IssuePagingNum)
expectedIssueCount := min(20, setting.UI.IssuePagingNum) // 20 is from the fixtures

link, _ := url.Parse("/api/v1/repos/issues/search")
token := getUserToken(t, "user1", auth_model.AccessTokenScopeReadIssue)
Expand Down Expand Up @@ -370,9 +368,7 @@ func TestAPISearchIssuesWithLabels(t *testing.T) {
defer tests.PrepareTestEnv(t)()

// as this API was used in the frontend, it uses UI page size
expectedIssueCount := min(
// from the fixtures
20, setting.UI.IssuePagingNum)
expectedIssueCount := min(20, setting.UI.IssuePagingNum) // 20 is from the fixtures

link, _ := url.Parse("/api/v1/repos/issues/search")
token := getUserToken(t, "user1", auth_model.AccessTokenScopeReadIssue)
Expand Down
8 changes: 2 additions & 6 deletions tests/integration/issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,7 @@ func TestSearchIssues(t *testing.T) {

session := loginUser(t, "user2")

expectedIssueCount := min(
// from the fixtures
20, setting.UI.IssuePagingNum)
expectedIssueCount := min(20, setting.UI.IssuePagingNum) // 20 is from the fixtures

link, _ := url.Parse("/issues/search")
req := NewRequest(t, "GET", link.String())
Expand Down Expand Up @@ -581,9 +579,7 @@ func TestSearchIssues(t *testing.T) {
func TestSearchIssuesWithLabels(t *testing.T) {
defer tests.PrepareTestEnv(t)()

expectedIssueCount := min(
// from the fixtures
20, setting.UI.IssuePagingNum)
expectedIssueCount := min(20, setting.UI.IssuePagingNum) // 20 is from the fixtures

session := loginUser(t, "user1")
link, _ := url.Parse("/issues/search")
Expand Down