Skip to content

Commit 915a14e

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Remove unused param `doer` (go-gitea#34545) Improve alignment of commit status icon on commit page (go-gitea#34750) Run `gopls modernize` on codebase (go-gitea#34751) Refactor some file edit related code (go-gitea#34744) [skip ci] Updated translations via Crowdin Fix ghost user in feeds when pushing in an actions, it should be gitea-actions (go-gitea#34703) upgrade orgmode to v1.8.0 (go-gitea#34721) Support title and body query parameters for new PRs (go-gitea#34537) Improve nuget/rubygems package registries (go-gitea#34741) Replace update repository function in some places (go-gitea#34566) remove unnecessary duplicate code (go-gitea#34733) fix: prevent double markdown link brackets when pasting URL (go-gitea#34745) Fix JS error for "select" dropdown (go-gitea#34743) [skip ci] Updated translations via Crowdin Allow renaming/moving binary/LFS files in the UI (go-gitea#34350) Clean bindata (go-gitea#34728) Refactor container and UI (go-gitea#34736) Prevent duplicate form submissions when creating forks (go-gitea#34714)
2 parents 13fa5f4 + 08c634b commit 915a14e

File tree

267 files changed

+2115
-1434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+2115
-1434
lines changed

.dockerignore

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ _testmain.go
3636
coverage.all
3737
cpu.out
3838

39-
/modules/migration/bindata.go
40-
/modules/migration/bindata.go.hash
41-
/modules/options/bindata.go
42-
/modules/options/bindata.go.hash
43-
/modules/public/bindata.go
44-
/modules/public/bindata.go.hash
45-
/modules/templates/bindata.go
46-
/modules/templates/bindata.go.hash
47-
4839
*.db
4940
*.log
5041

.ignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
*.min.css
22
*.min.js
33
/assets/*.json
4-
/modules/options/bindata.go
5-
/modules/public/bindata.go
6-
/modules/templates/bindata.go
74
/options/gitignore
85
/options/license
96
/public/assets

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ WEBPACK_CONFIGS := webpack.config.js tailwind.config.js
120120
WEBPACK_DEST := public/assets/js/index.js public/assets/css/index.css
121121
WEBPACK_DEST_ENTRIES := public/assets/js public/assets/css public/assets/fonts
122122

123-
BINDATA_DEST := modules/public/bindata.dat modules/options/bindata.dat modules/templates/bindata.dat
123+
BINDATA_DEST_WILDCARD := modules/migration/bindata.* modules/public/bindata.* modules/options/bindata.* modules/templates/bindata.*
124124

125125
GENERATED_GO_DEST := modules/charset/invisible_gen.go modules/charset/ambiguous_gen.go
126126

@@ -219,7 +219,7 @@ clean-all: clean ## delete backend, frontend and integration files
219219

220220
.PHONY: clean
221221
clean: ## delete backend and integration files
222-
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) \
222+
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST_WILDCARD) \
223223
integrations*.test \
224224
e2e*.test \
225225
tests/integration/gitea-integration-* \

cmd/cert.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ func runCert(_ context.Context, c *cli.Command) error {
156156
BasicConstraintsValid: true,
157157
}
158158

159-
hosts := strings.Split(c.String("host"), ",")
160-
for _, h := range hosts {
159+
hosts := strings.SplitSeq(c.String("host"), ",")
160+
for h := range hosts {
161161
if ip := net.ParseIP(h); ip != nil {
162162
template.IPAddresses = append(template.IPAddresses, ip)
163163
} else {

cmd/dump_repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ func runDumpRepository(ctx context.Context, cmd *cli.Command) error {
137137
opts.PullRequests = true
138138
opts.ReleaseAssets = true
139139
} else {
140-
units := strings.Split(cmd.String("units"), ",")
141-
for _, unit := range units {
140+
units := strings.SplitSeq(cmd.String("units"), ",")
141+
for unit := range units {
142142
switch strings.ToLower(strings.TrimSpace(unit)) {
143143
case "":
144144
continue

cmd/hook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ func hookPrintResult(output, isCreate bool, branch, url string) {
480480
func pushOptions() map[string]string {
481481
opts := make(map[string]string)
482482
if pushCount, err := strconv.Atoi(os.Getenv(private.GitPushOptionCount)); err == nil {
483-
for idx := 0; idx < pushCount; idx++ {
483+
for idx := range pushCount {
484484
opt := os.Getenv(fmt.Sprintf("GIT_PUSH_OPTION_%d", idx))
485485
kv := strings.SplitN(opt, "=", 2)
486486
if len(kv) == 2 {
@@ -732,7 +732,7 @@ func readPktLine(ctx context.Context, in *bufio.Reader, requestType pktLineType)
732732

733733
// read prefix
734734
lengthBytes := make([]byte, 4)
735-
for i := 0; i < 4; i++ {
735+
for i := range 4 {
736736
lengthBytes[i], err = in.ReadByte()
737737
if err != nil {
738738
return nil, fail(ctx, "Protocol: stdin error", "Pkt-Line: read stdin failed : %v", err)

contrib/backport/backport.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ func determineRemote(ctx context.Context, forkUser string) (string, string, erro
337337
fmt.Fprintf(os.Stderr, "Unable to list git remotes:\n%s\n", string(out))
338338
return "", "", fmt.Errorf("unable to determine forked remote: %w", err)
339339
}
340-
lines := strings.Split(string(out), "\n")
341-
for _, line := range lines {
340+
lines := strings.SplitSeq(string(out), "\n")
341+
for line := range lines {
342342
fields := strings.Split(line, "\t")
343343
name, remote := fields[0], fields[1]
344344
// only look at pushers
@@ -356,12 +356,12 @@ func determineRemote(ctx context.Context, forkUser string) (string, string, erro
356356
if !strings.Contains(remote, forkUser) {
357357
continue
358358
}
359-
if strings.HasPrefix(remote, "[email protected]:") {
360-
forkUser = strings.TrimPrefix(remote, "[email protected]:")
361-
} else if strings.HasPrefix(remote, "https://github.com/") {
362-
forkUser = strings.TrimPrefix(remote, "https://github.com/")
363-
} else if strings.HasPrefix(remote, "https://www.github.com/") {
364-
forkUser = strings.TrimPrefix(remote, "https://www.github.com/")
359+
if after, ok := strings.CutPrefix(remote, "[email protected]:"); ok {
360+
forkUser = after
361+
} else if after, ok := strings.CutPrefix(remote, "https://github.com/"); ok {
362+
forkUser = after
363+
} else if after, ok := strings.CutPrefix(remote, "https://www.github.com/"); ok {
364+
forkUser = after
365365
} else if forkUser == "" {
366366
return "", "", fmt.Errorf("unable to extract forkUser from remote %s: %s", name, remote)
367367
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ require (
9191
github.com/minio/minio-go/v7 v7.0.91
9292
github.com/msteinert/pam v1.2.0
9393
github.com/nektos/act v0.2.63
94-
github.com/niklasfasching/go-org v1.7.0
94+
github.com/niklasfasching/go-org v1.8.0
9595
github.com/olivere/elastic/v7 v7.0.32
9696
github.com/opencontainers/go-digest v1.0.0
9797
github.com/opencontainers/image-spec v1.1.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ github.com/msteinert/pam v1.2.0 h1:mYfjlvN2KYs2Pb9G6nb/1f/nPfAttT/Jee5Sq9r3bGE=
551551
github.com/msteinert/pam v1.2.0/go.mod h1:d2n0DCUK8rGecChV3JzvmsDjOY4R7AYbsNxAT+ftQl0=
552552
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
553553
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
554-
github.com/niklasfasching/go-org v1.7.0 h1:vyMdcMWWTe/XmANk19F4k8XGBYg0GQ/gJGMimOjGMek=
555-
github.com/niklasfasching/go-org v1.7.0/go.mod h1:WuVm4d45oePiE0eX25GqTDQIt/qPW1T9DGkRscqLW5o=
554+
github.com/niklasfasching/go-org v1.8.0 h1:WyGLaajLLp8JbQzkmapZ1y0MOzKuKV47HkZRloi+HGY=
555+
github.com/niklasfasching/go-org v1.8.0/go.mod h1:e2A9zJs7cdONrEGs3gvxCcaAEpwwPNPG7csDpXckMNg=
556556
github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
557557
github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9lEc=
558558
github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=

models/actions/status.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
package actions
55

66
import (
7+
"slices"
8+
79
"code.gitea.io/gitea/modules/translation"
810

911
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
@@ -88,12 +90,7 @@ func (s Status) IsBlocked() bool {
8890

8991
// In returns whether s is one of the given statuses
9092
func (s Status) In(statuses ...Status) bool {
91-
for _, v := range statuses {
92-
if s == v {
93-
return true
94-
}
95-
}
96-
return false
93+
return slices.Contains(statuses, s)
9794
}
9895

9996
func (s Status) AsResult() runnerv1.Result {

0 commit comments

Comments
 (0)