Skip to content

Commit 06198a4

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: fix: auto-expand and auto-scroll for actions logs (go-gitea#35570) (go-gitea#35583) [skip ci] Updated translations via Crowdin [skip ci] Updated translations via Crowdin Fix creating pull request failure when the target branch name is the same as some tag (go-gitea#35552) Use bundled version of spectral (go-gitea#35573) Add rebase push display wrong comments bug (go-gitea#35560) Address some CodeQL security concerns (go-gitea#35572) fix(webhook): prevent tag events from bypassing branch filters targets go-gitea#35449 (go-gitea#35567) Added button to copy file name in PR files (go-gitea#35509) Update JS and PY deps (go-gitea#35565) Enable a few more tsconfig options (go-gitea#35553) Bump github.com/wneessen/go-mail from 0.6.2 to 0.7.1 (go-gitea#35557) add more routes to the "expensive" list (go-gitea#35547) Drop json-iterator dependency (go-gitea#35544) Add proper error message if session provider can not be created (go-gitea#35520) use experimental go json v2 library (go-gitea#35392) Use global lock instead of status pool for cron lock (go-gitea#35507) Move some functions to gitrepo package (go-gitea#35503) Move GetDiverging functions to gitrepo (go-gitea#35524) [skip ci] Updated translations via Crowdin
2 parents d7fd235 + 0a0baeb commit 06198a4

File tree

136 files changed

+2764
-2556
lines changed

Some content is hidden

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

136 files changed

+2764
-2556
lines changed

.github/workflows/pull-db-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ jobs:
7272
go-version-file: go.mod
7373
check-latest: true
7474
- run: make deps-backend
75-
- run: make backend
75+
- run: GOEXPERIMENT='' make backend
7676
env:
7777
TAGS: bindata gogit sqlite sqlite_unlock_notify
7878
- name: run migration tests
7979
run: make test-sqlite-migration
8080
- name: run tests
81-
run: make test-sqlite
81+
run: GOEXPERIMENT='' make test-sqlite
8282
timeout-minutes: 50
8383
env:
8484
TAGS: bindata gogit sqlite sqlite_unlock_notify
@@ -142,7 +142,7 @@ jobs:
142142
RACE_ENABLED: true
143143
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
144144
- name: unit-tests-gogit
145-
run: make unit-test-coverage test-check
145+
run: GOEXPERIMENT='' make unit-test-coverage test-check
146146
env:
147147
TAGS: bindata gogit
148148
RACE_ENABLED: true

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ DIST := dist
1818
DIST_DIRS := $(DIST)/binaries $(DIST)/release
1919
IMPORT := code.gitea.io/gitea
2020

21+
# By default use go's 1.25 experimental json v2 library when building
22+
# TODO: remove when no longer experimental
23+
export GOEXPERIMENT ?= jsonv2
24+
2125
GO ?= go
2226
SHASUM ?= shasum -a 256
2327
HAS_GO := $(shell hash $(GO) > /dev/null 2>&1 && echo yes)
@@ -766,7 +770,7 @@ generate-go: $(TAGS_PREREQ)
766770

767771
.PHONY: security-check
768772
security-check:
769-
go run $(GOVULNCHECK_PACKAGE) -show color ./...
773+
GOEXPERIMENT= go run $(GOVULNCHECK_PACKAGE) -show color ./...
770774

771775
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
772776
ifneq ($(and $(STATIC),$(findstring pam,$(TAGS))),)

cmd/admin_user_create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func runCreateUser(ctx context.Context, c *cli.Command) error {
151151
if err != nil {
152152
return err
153153
}
154+
// codeql[disable-next-line=go/clear-text-logging]
154155
fmt.Printf("generated random password is '%s'\n", password)
155156
} else if userType == user_model.UserTypeIndividual {
156157
return errors.New("must set either password or random-password flag")

cmd/admin_user_must_change_password.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func runMustChangePassword(ctx context.Context, c *cli.Command) error {
5858
return err
5959
}
6060

61+
// codeql[disable-next-line=go/clear-text-logging]
6162
fmt.Printf("Updated %d users setting MustChangePassword to %t\n", n, mustChangePassword)
6263
return nil
6364
}

cmd/generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func runGenerateSecretKey(_ context.Context, c *cli.Command) error {
9191
return err
9292
}
9393

94+
// codeql[disable-next-line=go/clear-text-logging]
9495
fmt.Printf("%s", secretKey)
9596

9697
if isatty.IsTerminal(os.Stdout.Fd()) {

cmd/hook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Gitea or set your environment appropriately.`, "")
186186
userID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPusherID), 10, 64)
187187
prID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPRID), 10, 64)
188188
deployKeyID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvDeployKeyID), 10, 64)
189-
actionPerm, _ := strconv.ParseInt(os.Getenv(repo_module.EnvActionPerm), 10, 64)
189+
actionPerm, _ := strconv.Atoi(os.Getenv(repo_module.EnvActionPerm))
190190

191191
hookOptions := private.HookOptions{
192192
UserID: userID,
@@ -196,7 +196,7 @@ Gitea or set your environment appropriately.`, "")
196196
GitPushOptions: pushOptions(),
197197
PullRequestID: prID,
198198
DeployKeyID: deployKeyID,
199-
ActionPerm: int(actionPerm),
199+
ActionPerm: actionPerm,
200200
}
201201

202202
scanner := bufio.NewScanner(os.Stdin)

go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
gitea.com/go-chi/binding v0.0.0-20240430071103-39a851e106ed
1717
gitea.com/go-chi/cache v0.2.1
1818
gitea.com/go-chi/captcha v0.0.0-20240315150714-fb487f629098
19-
gitea.com/go-chi/session v0.0.0-20240316035857-16768d98ec96
19+
gitea.com/go-chi/session v0.0.0-20250926004215-636cadd82e15
2020
gitea.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
2121
gitea.com/lunny/levelqueue v0.4.2-0.20230414023320-3c0159fe0fe4
2222
github.com/42wim/httpsig v1.2.3
@@ -61,6 +61,7 @@ require (
6161
github.com/go-redsync/redsync/v4 v4.13.0
6262
github.com/go-sql-driver/mysql v1.9.3
6363
github.com/go-webauthn/webauthn v0.13.4
64+
github.com/goccy/go-json v0.10.5
6465
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
6566
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
6667
github.com/golang-jwt/jwt/v5 v5.3.0
@@ -75,7 +76,6 @@ require (
7576
github.com/huandu/xstrings v1.5.0
7677
github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056
7778
github.com/jhillyerd/enmime v1.3.0
78-
github.com/json-iterator/go v1.1.12
7979
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
8080
github.com/klauspost/compress v1.18.0
8181
github.com/klauspost/cpuid/v2 v2.3.0
@@ -109,7 +109,7 @@ require (
109109
github.com/ulikunitz/xz v0.5.15
110110
github.com/urfave/cli-docs/v3 v3.0.0-alpha6
111111
github.com/urfave/cli/v3 v3.4.1
112-
github.com/wneessen/go-mail v0.6.2
112+
github.com/wneessen/go-mail v0.7.1
113113
github.com/xeipuuv/gojsonschema v1.2.0
114114
github.com/yohcop/openid-go v1.0.1
115115
github.com/yuin/goldmark v1.7.13
@@ -120,9 +120,9 @@ require (
120120
golang.org/x/image v0.30.0
121121
golang.org/x/net v0.43.0
122122
golang.org/x/oauth2 v0.30.0
123-
golang.org/x/sync v0.16.0
123+
golang.org/x/sync v0.17.0
124124
golang.org/x/sys v0.35.0
125-
golang.org/x/text v0.28.0
125+
golang.org/x/text v0.29.0
126126
google.golang.org/grpc v1.75.0
127127
google.golang.org/protobuf v1.36.8
128128
gopkg.in/ini.v1 v1.67.0
@@ -200,7 +200,6 @@ require (
200200
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
201201
github.com/go-ini/ini v1.67.0 // indirect
202202
github.com/go-webauthn/x v0.1.24 // indirect
203-
github.com/goccy/go-json v0.10.5 // indirect
204203
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
205204
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
206205
github.com/golang-sql/sqlexp v0.1.0 // indirect
@@ -220,6 +219,7 @@ require (
220219
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
221220
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
222221
github.com/josharian/intern v1.0.0 // indirect
222+
github.com/json-iterator/go v1.1.12 // indirect
223223
github.com/kevinburke/ssh_config v1.4.0 // indirect
224224
github.com/klauspost/pgzip v1.2.6 // indirect
225225
github.com/libdns/libdns v1.1.1 // indirect
@@ -277,7 +277,7 @@ require (
277277
go.uber.org/zap v1.27.0 // indirect
278278
go.uber.org/zap/exp v0.3.0 // indirect
279279
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
280-
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
280+
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b // indirect
281281
golang.org/x/mod v0.27.0 // indirect
282282
golang.org/x/time v0.12.0 // indirect
283283
golang.org/x/tools v0.36.0 // indirect

go.sum

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ gitea.com/go-chi/cache v0.2.1 h1:bfAPkvXlbcZxPCpcmDVCWoHgiBSBmZN/QosnZvEC0+g=
4343
gitea.com/go-chi/cache v0.2.1/go.mod h1:Qic0HZ8hOHW62ETGbonpwz8WYypj9NieU9659wFUJ8Q=
4444
gitea.com/go-chi/captcha v0.0.0-20240315150714-fb487f629098 h1:p2ki+WK0cIeNQuqjR98IP2KZQKRzJJiV7aTeMAFwaWo=
4545
gitea.com/go-chi/captcha v0.0.0-20240315150714-fb487f629098/go.mod h1:LjzIOHlRemuUyO7WR12fmm18VZIlCAaOt9L3yKw40pk=
46-
gitea.com/go-chi/session v0.0.0-20240316035857-16768d98ec96 h1:IFDiMBObsP6CZIRaDLd54SR6zPYAffPXiXck5Xslu0Q=
47-
gitea.com/go-chi/session v0.0.0-20240316035857-16768d98ec96/go.mod h1:0iEpFKnwO5dG0aF98O4eq6FMsAiXkNBaDIlUOlq4BtM=
46+
gitea.com/go-chi/session v0.0.0-20250926004215-636cadd82e15 h1:qFYmz05u/s9664o7+XEgrlHXSPQ4uHO8/ccZGUb1uxA=
47+
gitea.com/go-chi/session v0.0.0-20250926004215-636cadd82e15/go.mod h1:0iEpFKnwO5dG0aF98O4eq6FMsAiXkNBaDIlUOlq4BtM=
4848
gitea.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96 h1:+wWBi6Qfruqu7xJgjOIrKVQGiLUZdpKYCZewJ4clqhw=
4949
gitea.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96/go.mod h1:VyMQP6ue6MKHM8UsOXfNfuMKD0oSAWZdXVcpHIN2yaY=
5050
gitea.com/lunny/levelqueue v0.4.2-0.20230414023320-3c0159fe0fe4 h1:IFT+hup2xejHqdhS7keYWioqfmxdnfblFDTGoOwcZ+o=
@@ -765,8 +765,8 @@ github.com/urfave/cli/v3 v3.4.1/go.mod h1:FJSKtM/9AiiTOJL4fJ6TbMUkxBXn7GO9guZqoZ
765765
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
766766
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
767767
github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
768-
github.com/wneessen/go-mail v0.6.2 h1:c6V7c8D2mz868z9WJ+8zDKtUyLfZ1++uAZmo2GRFji8=
769-
github.com/wneessen/go-mail v0.6.2/go.mod h1:L/PYjPK3/2ZlNb2/FjEBIn9n1rUWjW+Toy531oVmeb4=
768+
github.com/wneessen/go-mail v0.7.1 h1:rvy63sp14N06/kdGqCYwW8Na5gDCXjTQM1E7So4PuKk=
769+
github.com/wneessen/go-mail v0.7.1/go.mod h1:+TkW6QP3EVkgTEqHtVmnAE/1MRhmzb8Y9/W3pweuS+k=
770770
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
771771
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
772772
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
@@ -837,7 +837,6 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf
837837
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
838838
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
839839
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
840-
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
841840
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
842841
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
843842
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -848,8 +847,8 @@ golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE
848847
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
849848
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
850849
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
851-
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw=
852-
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM=
850+
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b h1:DXr+pvt3nC887026GRP39Ej11UATqWDmWuS99x26cD0=
851+
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b/go.mod h1:4QTo5u+SEIbbKW1RacMZq1YEfOBqeXa19JeshGi+zc4=
853852
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
854853
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
855854
golang.org/x/image v0.30.0 h1:jD5RhkmVAnjqaCUXfbGBrn3lpxbknfN9w2UhHHU+5B4=
@@ -930,9 +929,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
930929
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
931930
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
932931
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
933-
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
934-
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
935-
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
932+
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
933+
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
936934
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
937935
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
938936
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -974,7 +972,6 @@ golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
974972
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
975973
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
976974
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
977-
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
978975
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
979976
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
980977
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
@@ -987,7 +984,6 @@ golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
987984
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
988985
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
989986
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
990-
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
991987
golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
992988
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
993989
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1003,9 +999,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
1003999
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
10041000
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
10051001
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
1006-
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
1007-
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
1008-
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
1002+
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
1003+
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
10091004
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
10101005
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
10111006
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=

models/fixtures/branch.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,15 @@
213213
is_deleted: false
214214
deleted_by_id: 0
215215
deleted_unix: 0
216+
217+
-
218+
id: 26
219+
repo_id: 10
220+
name: 'feature/1'
221+
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
222+
commit_message: 'Initial commit'
223+
commit_time: 1489950479
224+
pusher_id: 2
225+
is_deleted: false
226+
deleted_by_id: 0
227+
deleted_unix: 0

models/issues/pull.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,6 @@ func (pr *PullRequest) GetGitHeadRefName() string {
417417
return fmt.Sprintf("%s%d/head", git.PullPrefix, pr.Index)
418418
}
419419

420-
func (pr *PullRequest) GetGitHeadBranchRefName() string {
421-
return fmt.Sprintf("%s%s", git.BranchPrefix, pr.HeadBranch)
422-
}
423-
424420
// GetReviewCommentsCount returns the number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR)
425421
func (pr *PullRequest) GetReviewCommentsCount(ctx context.Context) int {
426422
opts := FindCommentsOptions{
@@ -646,9 +642,8 @@ func (pr *PullRequest) UpdateCols(ctx context.Context, cols ...string) error {
646642
}
647643

648644
// UpdateColsIfNotMerged updates specific fields of a pull request if it has not been merged
649-
func (pr *PullRequest) UpdateColsIfNotMerged(ctx context.Context, cols ...string) error {
650-
_, err := db.GetEngine(ctx).Where("id = ? AND has_merged = ?", pr.ID, false).Cols(cols...).Update(pr)
651-
return err
645+
func (pr *PullRequest) UpdateColsIfNotMerged(ctx context.Context, cols ...string) (int64, error) {
646+
return db.GetEngine(ctx).Where("id = ? AND has_merged = ?", pr.ID, false).Cols(cols...).Update(pr)
652647
}
653648

654649
// IsWorkInProgress determine if the Pull Request is a Work In Progress by its title

0 commit comments

Comments
 (0)