Skip to content

Commit 2461d52

Browse files
Merge remote-tracking branch 'upstream/master' into branch-protection-anyone
2 parents 21f8590 + 08ae6bb commit 2461d52

Some content is hidden

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

94 files changed

+4622
-5977
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/public/js/semantic.dropdown.custom.js
2+
/web_src/js/vendor/**

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
node: true
1515

1616
globals:
17+
__webpack_public_path__: true
1718
Clipboard: false
1819
CodeMirror: false
1920
Dropzone: false

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ require (
99
gitea.com/macaron/captcha v0.0.0-20190822015246-daa973478bae
1010
gitea.com/macaron/cors v0.0.0-20190821152825-7dcef4a17175
1111
gitea.com/macaron/csrf v0.0.0-20190822024205-3dc5a4474439
12+
gitea.com/macaron/gzip v0.0.0-20191118033930-0c4c5566a0e5
1213
gitea.com/macaron/i18n v0.0.0-20190822004228-474e714e2223
1314
gitea.com/macaron/inject v0.0.0-20190805023432-d4c86e31027a
1415
gitea.com/macaron/macaron v1.3.3-0.20190821202302-9646c0587edb
@@ -55,9 +56,7 @@ require (
5556
github.com/joho/godotenv v1.3.0 // indirect
5657
github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657
5758
github.com/keybase/go-crypto v0.0.0-20170605145657-00ac4db533f6
58-
github.com/klauspost/compress v0.0.0-20161025140425-8df558b6cb6f
59-
github.com/klauspost/cpuid v0.0.0-20160302075316-09cded8978dc // indirect
60-
github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6 // indirect
59+
github.com/klauspost/compress v1.9.2
6160
github.com/lafriks/xormstore v1.3.2
6261
github.com/lib/pq v1.2.0
6362
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96

go.sum

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ gitea.com/macaron/cors v0.0.0-20190821152825-7dcef4a17175 h1:ikzdAGB6SsUGByW5wKl
2020
gitea.com/macaron/cors v0.0.0-20190821152825-7dcef4a17175/go.mod h1:rtOK4J20kpMD9XcNsnO5YA843YSTe/MUMbDj/TJ/Q7A=
2121
gitea.com/macaron/csrf v0.0.0-20190822024205-3dc5a4474439 h1:88c34YM29a1GlWLrLBaG/GTT2htDdJz1u3n9+lmPolg=
2222
gitea.com/macaron/csrf v0.0.0-20190822024205-3dc5a4474439/go.mod h1:IsQPHx73HnnqFBYiVHjg87q4XBZyGXXu77xANukvZuk=
23+
gitea.com/macaron/gzip v0.0.0-20191118033930-0c4c5566a0e5 h1:G/a7r0r2jEelSynBlv1+PAEZQKfsdRHQUMb1PlNvemM=
24+
gitea.com/macaron/gzip v0.0.0-20191118033930-0c4c5566a0e5/go.mod h1:jGHtoovArcQj+sw7NJxyPgjuRxOSG9a/oFu3VkLRTKQ=
2325
gitea.com/macaron/i18n v0.0.0-20190822004228-474e714e2223 h1:iZWwQif/LHMjBgfY/ua8CFVa4XMDfbbs7EZ0Q1dYguU=
2426
gitea.com/macaron/i18n v0.0.0-20190822004228-474e714e2223/go.mod h1:+qsc10s4hBsHKU/9luGGumFh4m5FFVc7uih+8/mM1NY=
2527
gitea.com/macaron/inject v0.0.0-20190803172902-8375ba841591/go.mod h1:h6E4kLao1Yko6DOU6QDnQPcuoNzvbZqzj2mtPcEn1aM=
@@ -334,12 +336,8 @@ github.com/keybase/go-crypto v0.0.0-20170605145657-00ac4db533f6/go.mod h1:ghbZsc
334336
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
335337
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
336338
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
337-
github.com/klauspost/compress v0.0.0-20161025140425-8df558b6cb6f h1:tCnZKEmDovgV4jmsclh6CuKk9AMzTzyVWfejgkgccVg=
338-
github.com/klauspost/compress v0.0.0-20161025140425-8df558b6cb6f/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
339-
github.com/klauspost/cpuid v0.0.0-20160302075316-09cded8978dc h1:WW8B7p7QBnFlqRVv/k6ro/S8Z7tCnYjJHcQNScx9YVs=
340-
github.com/klauspost/cpuid v0.0.0-20160302075316-09cded8978dc/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
341-
github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6 h1:KAZ1BW2TCmT6PRihDPpocIy1QTtsAsrx6TneU/4+CMg=
342-
github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg=
339+
github.com/klauspost/compress v1.9.2 h1:LfVyl+ZlLlLDeQ/d2AqfGIIH4qEDu0Ed2S5GyhCWIWY=
340+
github.com/klauspost/compress v1.9.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
343341
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
344342
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
345343
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=

integrations/lfs_getobject_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import (
1515
"testing"
1616

1717
"code.gitea.io/gitea/models"
18-
"code.gitea.io/gitea/modules/gzip"
1918
"code.gitea.io/gitea/modules/lfs"
2019
"code.gitea.io/gitea/modules/setting"
2120

21+
"gitea.com/macaron/gzip"
2222
gzipp "github.com/klauspost/compress/gzip"
2323
"github.com/stretchr/testify/assert"
2424
)

models/issue.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,19 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
12191219
return issues, nil
12201220
}
12211221

1222+
// GetParticipantsIDsByIssueID returns the IDs of all users who participated in comments of an issue,
1223+
// but skips joining with `user` for performance reasons.
1224+
// User permissions must be verified elsewhere if required.
1225+
func GetParticipantsIDsByIssueID(issueID int64) ([]int64, error) {
1226+
userIDs := make([]int64, 0, 5)
1227+
return userIDs, x.Table("comment").
1228+
Cols("poster_id").
1229+
Where("issue_id = ?", issueID).
1230+
And("type in (?,?,?)", CommentTypeComment, CommentTypeCode, CommentTypeReview).
1231+
Distinct("poster_id").
1232+
Find(&userIDs)
1233+
}
1234+
12221235
// GetParticipantsByIssueID returns all users who are participated in comments of an issue.
12231236
func GetParticipantsByIssueID(issueID int64) ([]*User, error) {
12241237
return getParticipantsByIssueID(x, issueID)

models/issue_assignees.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ func (issue *Issue) loadAssignees(e Engine) (err error) {
4141
return
4242
}
4343

44+
// GetAssigneeIDsByIssue returns the IDs of users assigned to an issue
45+
// but skips joining with `user` for performance reasons.
46+
// User permissions must be verified elsewhere if required.
47+
func GetAssigneeIDsByIssue(issueID int64) ([]int64, error) {
48+
userIDs := make([]int64, 0, 5)
49+
return userIDs, x.Table("issue_assignees").
50+
Cols("assignee_id").
51+
Where("issue_id = ?", issueID).
52+
Distinct("assignee_id").
53+
Find(&userIDs)
54+
}
55+
4456
// GetAssigneesByIssue returns everyone assigned to that issue
4557
func GetAssigneesByIssue(issue *Issue) (assignees []*User, err error) {
4658
return getAssigneesByIssue(x, issue)

models/issue_watch.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ func getIssueWatch(e Engine, userID, issueID int64) (iw *IssueWatch, exists bool
6060
return
6161
}
6262

63+
// GetIssueWatchersIDs returns IDs of subscribers to a given issue id
64+
// but avoids joining with `user` for performance reasons
65+
// User permissions must be verified elsewhere if required
66+
func GetIssueWatchersIDs(issueID int64) ([]int64, error) {
67+
ids := make([]int64, 0, 64)
68+
return ids, x.Table("issue_watch").
69+
Where("issue_id=?", issueID).
70+
And("is_watching = ?", true).
71+
Select("user_id").
72+
Find(&ids)
73+
}
74+
6375
// GetIssueWatchers returns watchers/unwatchers of a given issue
6476
func GetIssueWatchers(issueID int64) (IssueWatchList, error) {
6577
return getIssueWatchers(x, issueID)

models/repo_watch.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ func GetWatchers(repoID int64) ([]*Watch, error) {
140140
return getWatchers(x, repoID)
141141
}
142142

143+
// GetRepoWatchersIDs returns IDs of watchers for a given repo ID
144+
// but avoids joining with `user` for performance reasons
145+
// User permissions must be verified elsewhere if required
146+
func GetRepoWatchersIDs(repoID int64) ([]int64, error) {
147+
ids := make([]int64, 0, 64)
148+
return ids, x.Table("watch").
149+
Where("watch.repo_id=?", repoID).
150+
And("watch.mode<>?", RepoWatchModeDont).
151+
Select("user_id").
152+
Find(&ids)
153+
}
154+
143155
// GetWatchers returns range of users watching given repository.
144156
func (repo *Repository) GetWatchers(page int) ([]*User, error) {
145157
users := make([]*User, 0, ItemsPerPage)

models/user.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,20 @@ func getUserEmailsByNames(e Engine, names []string) []string {
13071307
return mails
13081308
}
13091309

1310+
// GetMaileableUsersByIDs gets users from ids, but only if they can receive mails
1311+
func GetMaileableUsersByIDs(ids []int64) ([]*User, error) {
1312+
if len(ids) == 0 {
1313+
return nil, nil
1314+
}
1315+
ous := make([]*User, 0, len(ids))
1316+
return ous, x.In("id", ids).
1317+
Where("`type` = ?", UserTypeIndividual).
1318+
And("`prohibit_login` = ?", false).
1319+
And("`is_active` = ?", true).
1320+
And("`email_notifications_preference` = ?", EmailNotificationsEnabled).
1321+
Find(&ous)
1322+
}
1323+
13101324
// GetUsersByIDs returns all resolved users from a list of Ids.
13111325
func GetUsersByIDs(ids []int64) ([]*User, error) {
13121326
ous := make([]*User, 0, len(ids))

modules/gzip/gzip_test.go

Lines changed: 0 additions & 131 deletions
This file was deleted.

options/locale/locale_ja-JP.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@ migrate.migrating_failed=<b>%s</b> からの移行が失敗しました。
665665
666666
mirror_from=ミラー元
667667
forked_from=フォーク元
668-
generated_from=基に生成
669668
fork_from_self=自分が所有しているリポジトリはフォークできません。
670669
fork_guest_user=リポジトリをフォークするにはサインインしてください。
671670
copy_link=コピー

options/locale/locale_tr-TR.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ email_notifications.submit=E-posta Tercihlerini Ayarla
546546
owner=Sahibi
547547
repo_name=Depo İsmi
548548
repo_name_helper=İyi bir depo ismi kısa, akılda kalıcı ve özgün anahtar kelimelerden oluşur.
549+
repo_size=Depo Boyutu
549550
template=Şablon
550551
template_select=Bir şablon seçin.
551552
template_helper=Depoyu şablon yap
@@ -1632,6 +1633,7 @@ users.local=Yerel
16321633
users.password_helper=Şifreyi değiştirmemek için boş bırakın.
16331634
users.update_profile_success=Kullanıcı hesabı güncellendi.
16341635
users.edit_account=Kullanıcı Hesabını Düzenle
1636+
users.max_repo_creation=Maksimum Depo Sayısı
16351637
users.max_repo_creation_desc=(Genel varsayılan sınırı kullanmak için -1 girin.)
16361638
users.is_activated=Kullanıcı Hesabı Etkinleştirildi
16371639
users.prohibit_login=Oturum Açmayı Devre Dışı Bırak
@@ -1894,6 +1896,8 @@ compare_commits_general=İşlemeleri karşılaştır
18941896
mirror_sync_push=işlemeler yansıdan <a href="%[1]s">%[4]s</a> deposundaki <a href="%[1]s/src/%[2]s">%[3]s</a> dalına eşitlendi
18951897
mirror_sync_create=<a href="%s/src/%s">%[2]s</a> referansı <a href="%[1]s">%[3]s</a> için yansıdan senkronize edildi
18961898
mirror_sync_delete=<a href="%[1]s">%[3]s</a> adresindeki <code>%[2]s</code> referansı eşitlendi ve silindi
1899+
approve_pull_request=`<a href="%s/pulls/%s">%s#%[2]s</a> onaylandı`
1900+
reject_pull_request=`<a href="%s/pulls/%s">%s#%[2]s</a> için değişiklik önerdi `
18971901

18981902
[tool]
18991903
ago=%s önce

0 commit comments

Comments
 (0)