Skip to content

Commit 7a6ec83

Browse files
authored
Merge branch 'main' into fork-dialog
2 parents 43c0cfd + 0a9fcf6 commit 7a6ec83

File tree

384 files changed

+4232
-3545
lines changed

Some content is hidden

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

384 files changed

+4232
-3545
lines changed

.drone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ steps:
537537

538538
- name: static
539539
pull: always
540-
image: techknowlogick/xgo:go-1.16.x
540+
image: techknowlogick/xgo:go-1.17.x
541541
commands:
542542
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
543543
- export PATH=$PATH:$GOPATH/bin
@@ -633,7 +633,7 @@ steps:
633633

634634
- name: static
635635
pull: always
636-
image: techknowlogick/xgo:go-1.16.x
636+
image: techknowlogick/xgo:go-1.17.x
637637
commands:
638638
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
639639
- export PATH=$PATH:$GOPATH/bin

cmd/migrate_storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func migrateAvatars(dstStorage storage.ObjectStorage) error {
102102
}
103103

104104
func migrateRepoAvatars(dstStorage storage.ObjectStorage) error {
105-
return models.IterateRepository(func(repo *models.Repository) error {
105+
return models.IterateRepository(func(repo *repo_model.Repository) error {
106106
_, err := storage.Copy(dstStorage, repo.CustomAvatarRelativePath(), storage.RepoAvatars, repo.CustomAvatarRelativePath())
107107
return err
108108
})

cmd/web.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func setPort(port string) error {
180180
setting.HTTPPort = port
181181

182182
switch setting.Protocol {
183-
case setting.UnixSocket:
183+
case setting.HTTPUnix:
184184
case setting.FCGI:
185185
case setting.FCGIUnix:
186186
default:
@@ -202,7 +202,7 @@ func setPort(port string) error {
202202

203203
func listen(m http.Handler, handleRedirector bool) error {
204204
listenAddr := setting.HTTPAddr
205-
if setting.Protocol != setting.UnixSocket && setting.Protocol != setting.FCGIUnix {
205+
if setting.Protocol != setting.HTTPUnix && setting.Protocol != setting.FCGIUnix {
206206
listenAddr = net.JoinHostPort(listenAddr, setting.HTTPPort)
207207
}
208208
log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
@@ -240,7 +240,7 @@ func listen(m http.Handler, handleRedirector bool) error {
240240
NoHTTPRedirector()
241241
}
242242
err = runFCGI("tcp", listenAddr, "FCGI Web", m)
243-
case setting.UnixSocket:
243+
case setting.HTTPUnix:
244244
if handleRedirector {
245245
NoHTTPRedirector()
246246
}

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
233233

234234
## Server (`server`)
235235

236-
- `PROTOCOL`: **http**: \[http, https, fcgi, unix, fcgi+unix\]
236+
- `PROTOCOL`: **http**: \[http, https, fcgi, http+unix, fcgi+unix\]
237237
- `DOMAIN`: **localhost**: Domain name of this server.
238238
- `ROOT_URL`: **%(PROTOCOL)s://%(DOMAIN)s:%(HTTP\_PORT)s/**:
239239
Overwrite the automatically generated public URL.
@@ -248,7 +248,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
248248
- `HTTP_ADDR`: **0.0.0.0**: HTTP listen address.
249249
- If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket
250250
defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
251-
- If `PROTOCOL` is set to `unix` or `fcgi+unix`, this should be the name of the Unix socket file to use. Relative paths will be made absolute against the AppWorkPath.
251+
- If `PROTOCOL` is set to `http+unix` or `fcgi+unix`, this should be the name of the Unix socket file to use. Relative paths will be made absolute against the AppWorkPath.
252252
- `HTTP_PORT`: **3000**: HTTP listen port.
253253
- If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket
254254
defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
@@ -257,7 +257,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
257257
(DMZ) URL for Gitea workers (such as SSH update) accessing web service. In
258258
most cases you do not need to change the default value. Alter it only if
259259
your SSH server node is not the same as HTTP node. Do not set this variable
260-
if `PROTOCOL` is set to `unix`.
260+
if `PROTOCOL` is set to `http+unix`.
261261
- `PER_WRITE_TIMEOUT`: **30s**: Timeout for any write to the connection. (Set to 0 to
262262
disable all timeouts.)
263263
- `PER_WRITE_PER_KB_TIMEOUT`: **10s**: Timeout per Kb written to connections.

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ menu:
8484

8585
## Database (`database`)
8686

87-
- `DB_TYPE`: 数据库类型,可选 `mysql`, `postgres`, `mssql`, `tidb``sqlite3`
87+
- `DB_TYPE`: 数据库类型,可选 `mysql`, `postgres`, `mssql``sqlite3`
8888
- `HOST`: 数据库服务器地址和端口。
8989
- `NAME`: 数据库名称。
9090
- `USER`: 数据库用户名。
9191
- `PASSWD`: 数据库用户密码。
9292
- `SSL_MODE`: MySQL 或 PostgreSQL数据库是否启用SSL模式。
9393
- `CHARSET`: **utf8mb4**: 仅当数据库为 MySQL 时有效, 可以为 "utf8" 或 "utf8mb4"。注意:如果使用 "utf8mb4",你的 MySQL InnoDB 版本必须在 5.6 以上。
94-
- `PATH`: Tidb 或者 SQLite3 数据文件存放路径。
94+
- `PATH`: SQLite3 数据文件存放路径。
9595
- `LOG_SQL`: **true**: 显示生成的SQL,默认为真。
9696
- `MAX_IDLE_CONNS` **0**: 最大空闲数据库连接
9797
- `CONN_MAX_LIFETIME` **3s**: 数据库连接最大存活时间

docs/content/page/index.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
7373
- PostgreSQL (>=10)
7474
- SQLite3
7575
- MSSQL (>=2008R2 SP3)
76-
- TiDB (experimental, not recommended)
76+
- TiDB (MySQL protocol)
7777
- Configuration file
7878
- [app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
7979
- Admin panel

docs/content/page/index.fr-fr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Le but de ce projet est de fournir de la manière la plus simple, la plus rapide
6868
- PostgreSQL
6969
- SQLite3
7070
- MSSQL
71-
- [TiDB](https://github.com/pingcap/tidb) (expérimental)
71+
- [TiDB](https://github.com/pingcap/tidb) (MySQL protocol)
7272
- Fichier de configuration
7373
- Voir [ici](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
7474
- Panel d'administration

docs/content/page/index.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Gitea的首要目标是创建一个极易安装,运行非常快速,安装和
3232
- 支持自定义源的 Gravatar 和 Federated Avatar
3333
- 支持邮件服务
3434
- 支持后台管理面板
35-
- 支持 MySQL、PostgreSQL、SQLite3, MSSQL 和 TiDB(实验性支持) 数据库
35+
- 支持 MySQL、PostgreSQL、SQLite3MSSQL 和 TiDB(MySQL) 数据库
3636
- 支持多语言本地化(21 种语言)
3737

3838
## 系统要求

docs/content/page/index.zh-tw.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [G
6969
- PostgreSQL
7070
- SQLite3
7171
- MSSQL
72-
- TiDB(實驗中, 不建議使用
72+
- TiDB(MySQL 協議
7373
- 設定檔
7474
- [app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
7575
- 管理員面板

integrations/api_comment_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"testing"
1212

1313
"code.gitea.io/gitea/models"
14+
repo_model "code.gitea.io/gitea/models/repo"
1415
"code.gitea.io/gitea/models/unittest"
1516
user_model "code.gitea.io/gitea/models/user"
1617
"code.gitea.io/gitea/modules/convert"
@@ -25,7 +26,7 @@ func TestAPIListRepoComments(t *testing.T) {
2526
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
2627
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
2728
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
28-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
29+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
2930
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
3031

3132
session := loginUser(t, repoOwner.Name)
@@ -71,7 +72,7 @@ func TestAPIListIssueComments(t *testing.T) {
7172
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
7273
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
7374
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
74-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
75+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
7576
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
7677

7778
session := loginUser(t, repoOwner.Name)
@@ -91,7 +92,7 @@ func TestAPICreateComment(t *testing.T) {
9192
const commentBody = "Comment body"
9293

9394
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{}).(*models.Issue)
94-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
95+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
9596
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
9697

9798
session := loginUser(t, repoOwner.Name)
@@ -114,7 +115,7 @@ func TestAPIGetComment(t *testing.T) {
114115

115116
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{ID: 2}).(*models.Comment)
116117
assert.NoError(t, comment.LoadIssue())
117-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: comment.Issue.RepoID}).(*models.Repository)
118+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: comment.Issue.RepoID}).(*repo_model.Repository)
118119
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
119120

120121
session := loginUser(t, repoOwner.Name)
@@ -143,7 +144,7 @@ func TestAPIEditComment(t *testing.T) {
143144
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
144145
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
145146
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
146-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
147+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
147148
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
148149

149150
session := loginUser(t, repoOwner.Name)
@@ -168,7 +169,7 @@ func TestAPIDeleteComment(t *testing.T) {
168169
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
169170
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
170171
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
171-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
172+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
172173
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
173174

174175
session := loginUser(t, repoOwner.Name)

integrations/api_helper_for_declarative_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"testing"
1414
"time"
1515

16-
"code.gitea.io/gitea/models"
1716
"code.gitea.io/gitea/models/perm"
17+
repo_model "code.gitea.io/gitea/models/repo"
1818
"code.gitea.io/gitea/modules/json"
1919
"code.gitea.io/gitea/modules/queue"
2020
api "code.gitea.io/gitea/modules/structs"
@@ -264,7 +264,7 @@ func doAPIMergePullRequest(ctx APITestContext, owner, repo string, index int64)
264264
owner, repo, index, ctx.Token)
265265
req := NewRequestWithJSON(t, http.MethodPost, urlStr, &forms.MergePullRequestForm{
266266
MergeMessageField: "doAPIMergePullRequest Merge",
267-
Do: string(models.MergeStyleMerge),
267+
Do: string(repo_model.MergeStyleMerge),
268268
})
269269

270270
resp := ctx.Session.MakeRequest(t, req, NoExpectedStatus)
@@ -276,7 +276,7 @@ func doAPIMergePullRequest(ctx APITestContext, owner, repo string, index int64)
276276
queue.GetManager().FlushAll(context.Background(), 5*time.Second)
277277
req = NewRequestWithJSON(t, http.MethodPost, urlStr, &forms.MergePullRequestForm{
278278
MergeMessageField: "doAPIMergePullRequest Merge",
279-
Do: string(models.MergeStyleMerge),
279+
Do: string(repo_model.MergeStyleMerge),
280280
})
281281
resp = ctx.Session.MakeRequest(t, req, NoExpectedStatus)
282282
}
@@ -298,7 +298,7 @@ func doAPIManuallyMergePullRequest(ctx APITestContext, owner, repo, commitID str
298298
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/merge?token=%s",
299299
owner, repo, index, ctx.Token)
300300
req := NewRequestWithJSON(t, http.MethodPost, urlStr, &forms.MergePullRequestForm{
301-
Do: string(models.MergeStyleManuallyMerged),
301+
Do: string(repo_model.MergeStyleManuallyMerged),
302302
MergeCommitID: commitID,
303303
})
304304

integrations/api_issue_label_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"testing"
1212

1313
"code.gitea.io/gitea/models"
14+
repo_model "code.gitea.io/gitea/models/repo"
1415
"code.gitea.io/gitea/models/unittest"
1516
user_model "code.gitea.io/gitea/models/user"
1617
api "code.gitea.io/gitea/modules/structs"
@@ -21,7 +22,7 @@ import (
2122
func TestAPIModifyLabels(t *testing.T) {
2223
assert.NoError(t, unittest.LoadFixtures())
2324

24-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: 2}).(*models.Repository)
25+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 2}).(*repo_model.Repository)
2526
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
2627
session := loginUser(t, owner.Name)
2728
token := getTokenForLoggedInUser(t, session)
@@ -91,7 +92,7 @@ func TestAPIModifyLabels(t *testing.T) {
9192
func TestAPIAddIssueLabels(t *testing.T) {
9293
assert.NoError(t, unittest.LoadFixtures())
9394

94-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository)
95+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}).(*repo_model.Repository)
9596
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{RepoID: repo.ID}).(*models.Issue)
9697
_ = unittest.AssertExistsAndLoadBean(t, &models.Label{RepoID: repo.ID, ID: 2}).(*models.Label)
9798
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
@@ -114,7 +115,7 @@ func TestAPIAddIssueLabels(t *testing.T) {
114115
func TestAPIReplaceIssueLabels(t *testing.T) {
115116
assert.NoError(t, unittest.LoadFixtures())
116117

117-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository)
118+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}).(*repo_model.Repository)
118119
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{RepoID: repo.ID}).(*models.Issue)
119120
label := unittest.AssertExistsAndLoadBean(t, &models.Label{RepoID: repo.ID}).(*models.Label)
120121
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
@@ -140,7 +141,7 @@ func TestAPIReplaceIssueLabels(t *testing.T) {
140141
func TestAPIModifyOrgLabels(t *testing.T) {
141142
assert.NoError(t, unittest.LoadFixtures())
142143

143-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: 3}).(*models.Repository)
144+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 3}).(*repo_model.Repository)
144145
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
145146
user := "user1"
146147
session := loginUser(t, user)

integrations/api_issue_milestone_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"testing"
1111

1212
"code.gitea.io/gitea/models"
13+
repo_model "code.gitea.io/gitea/models/repo"
1314
"code.gitea.io/gitea/models/unittest"
1415
user_model "code.gitea.io/gitea/models/user"
1516
"code.gitea.io/gitea/modules/structs"
@@ -21,7 +22,7 @@ func TestAPIIssuesMilestone(t *testing.T) {
2122
defer prepareTestEnv(t)()
2223

2324
milestone := unittest.AssertExistsAndLoadBean(t, &models.Milestone{ID: 1}).(*models.Milestone)
24-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: milestone.RepoID}).(*models.Repository)
25+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: milestone.RepoID}).(*repo_model.Repository)
2526
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
2627
assert.Equal(t, int64(1), int64(milestone.NumIssues))
2728
assert.Equal(t, structs.StateOpen, milestone.State())

integrations/api_issue_stopwatch_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"testing"
1010

1111
"code.gitea.io/gitea/models"
12+
repo_model "code.gitea.io/gitea/models/repo"
1213
"code.gitea.io/gitea/models/unittest"
1314
user_model "code.gitea.io/gitea/models/user"
1415
api "code.gitea.io/gitea/modules/structs"
@@ -19,7 +20,7 @@ import (
1920
func TestAPIListStopWatches(t *testing.T) {
2021
defer prepareTestEnv(t)()
2122

22-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository)
23+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1}).(*repo_model.Repository)
2324
owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
2425

2526
session := loginUser(t, owner.Name)

integrations/api_issue_subscription_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"testing"
1111

1212
"code.gitea.io/gitea/models"
13+
repo_model "code.gitea.io/gitea/models/repo"
1314
"code.gitea.io/gitea/models/unittest"
1415
user_model "code.gitea.io/gitea/models/user"
1516
api "code.gitea.io/gitea/modules/structs"
@@ -33,7 +34,7 @@ func TestAPIIssueSubscriptions(t *testing.T) {
3334

3435
testSubscription := func(issue *models.Issue, isWatching bool) {
3536

36-
issueRepo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
37+
issueRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
3738

3839
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d/subscriptions/check?token=%s", issueRepo.OwnerName, issueRepo.Name, issue.Index, token)
3940
req := NewRequest(t, "GET", urlStr)
@@ -54,7 +55,7 @@ func TestAPIIssueSubscriptions(t *testing.T) {
5455
testSubscription(issue4, false)
5556
testSubscription(issue5, false)
5657

57-
issue1Repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue1.RepoID}).(*models.Repository)
58+
issue1Repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue1.RepoID}).(*repo_model.Repository)
5859
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d/subscriptions/%s?token=%s", issue1Repo.OwnerName, issue1Repo.Name, issue1.Index, owner.Name, token)
5960
req := NewRequest(t, "DELETE", urlStr)
6061
session.MakeRequest(t, req, http.StatusCreated)
@@ -64,7 +65,7 @@ func TestAPIIssueSubscriptions(t *testing.T) {
6465
session.MakeRequest(t, req, http.StatusOK)
6566
testSubscription(issue1, false)
6667

67-
issue5Repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue5.RepoID}).(*models.Repository)
68+
issue5Repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue5.RepoID}).(*repo_model.Repository)
6869
urlStr = fmt.Sprintf("/api/v1/repos/%s/%s/issues/%d/subscriptions/%s?token=%s", issue5Repo.OwnerName, issue5Repo.Name, issue5.Index, owner.Name, token)
6970
req = NewRequest(t, "PUT", urlStr)
7071
session.MakeRequest(t, req, http.StatusCreated)

0 commit comments

Comments
 (0)