Skip to content

Commit 853ea2c

Browse files
authored
Merge branch 'master' into pr-squash-comment
2 parents 5af08a9 + e8a354f commit 853ea2c

Some content is hidden

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

81 files changed

+402
-258
lines changed

custom/conf/app.example.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ ACTIVE_CODE_LIVE_MINUTES = 180
597597
RESET_PASSWD_CODE_LIVE_MINUTES = 180
598598
; Whether a new user needs to confirm their email when registering.
599599
REGISTER_EMAIL_CONFIRM = false
600+
; Whether a new user needs to be confirmed manually after registration. (Requires `REGISTER_EMAIL_CONFIRM` to be disabled.)
601+
REGISTER_MANUAL_CONFIRM = false
600602
; List of domain names that are allowed to be used to register on a Gitea instance
601603
; gitea.io,example.com
602604
EMAIL_DOMAIN_WHITELIST =

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ relation to port exhaustion.
422422
process.
423423
- `REGISTER_EMAIL_CONFIRM`: **false**: Enable this to ask for mail confirmation of registration.
424424
Requires `Mailer` to be enabled.
425+
- `REGISTER_MANUAL_CONFIRM`: **false**: Enable this to manually confirm new registrations.
426+
Requires `REGISTER_EMAIL_CONFIRM` to be disabled.
425427
- `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create
426428
accounts for users.
427429
- `REQUIRE_EXTERNAL_REGISTRATION_PASSWORD`: **false**: Enable this to force externally created

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ menu:
124124
- `ACTIVE_CODE_LIVE_MINUTES`: 登录验证码失效时间,单位分钟。
125125
- `RESET_PASSWD_CODE_LIVE_MINUTES`: 重置密码失效时间,单位分钟。
126126
- `REGISTER_EMAIL_CONFIRM`: 启用注册邮件激活,前提是 `Mailer` 已经启用。
127+
- `REGISTER_MANUAL_CONFIRM`: **false**: 新注册用户必须由管理员手动激活,启用此选项需取消`REGISTER_EMAIL_CONFIRM`.
127128
- `DISABLE_REGISTRATION`: 禁用注册,启用后只能用管理员添加用户。
128129
- `SHOW_REGISTRATION_BUTTON`: 是否显示注册按钮。
129130
- `REQUIRE_SIGNIN_VIEW`: 是否所有页面都必须登录后才可访问。

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ require (
107107
github.com/yuin/goldmark-meta v1.0.0
108108
go.jolheiser.com/hcaptcha v0.0.4
109109
go.jolheiser.com/pwn v0.0.3
110-
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
110+
golang.org/x/crypto v0.0.0-20201217014255-9d1352758620
111111
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102
112112
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
113113
golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,8 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rB
11781178
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
11791179
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
11801180
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
1181+
golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 h1:3wPMTskHO3+O6jqTEXyFcsnuxMQOqYSaHsDxcbUXpqA=
1182+
golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
11811183
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
11821184
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
11831185
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -1348,6 +1350,8 @@ golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPM
13481350
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
13491351
golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f h1:QdHQnPce6K4XQewki9WNbG5KOROuDzqO3NaYjI1cXJ0=
13501352
golang.org/x/sys v0.0.0-20201211090839-8ad439b19e0f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
1353+
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM=
1354+
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
13511355
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
13521356
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
13531357
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

integrations/mssql.ini.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ FROM = [email protected]
5555

5656
[service]
5757
REGISTER_EMAIL_CONFIRM = false
58+
REGISTER_MANUAL_CONFIRM = false
5859
ENABLE_NOTIFY_MAIL = false
5960
DISABLE_REGISTRATION = false
6061
ENABLE_CAPTCHA = false

integrations/mysql.ini.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ FROM = [email protected]
7676

7777
[service]
7878
REGISTER_EMAIL_CONFIRM = false
79+
REGISTER_MANUAL_CONFIRM = false
7980
ENABLE_NOTIFY_MAIL = false
8081
DISABLE_REGISTRATION = false
8182
ENABLE_CAPTCHA = false

integrations/mysql8.ini.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ ENABLED = false
5050

5151
[service]
5252
REGISTER_EMAIL_CONFIRM = false
53+
REGISTER_MANUAL_CONFIRM = false
5354
ENABLE_NOTIFY_MAIL = false
5455
DISABLE_REGISTRATION = false
5556
ENABLE_CAPTCHA = false

integrations/pgsql.ini.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ FROM = [email protected]
5656

5757
[service]
5858
REGISTER_EMAIL_CONFIRM = false
59+
REGISTER_MANUAL_CONFIRM = false
5960
ENABLE_NOTIFY_MAIL = false
6061
DISABLE_REGISTRATION = false
6162
ENABLE_CAPTCHA = false

integrations/repo_commits_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func doTestRepoCommitWithStatus(t *testing.T, state string, classes ...string) {
6565

6666
doc = NewHTMLParser(t, resp.Body)
6767
// Check if commit status is displayed in message column
68-
sel := doc.doc.Find("#commits-table tbody tr td.message i.commit-status")
68+
sel := doc.doc.Find("#commits-table tbody tr td.message a.commit-statuses-trigger i.commit-status")
6969
assert.Equal(t, sel.Length(), 1)
7070
for _, class := range classes {
7171
assert.True(t, sel.HasClass(class))

integrations/sqlite.ini.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ FROM = [email protected]
5252

5353
[service]
5454
REGISTER_EMAIL_CONFIRM = false
55+
REGISTER_MANUAL_CONFIRM = false
5556
ENABLE_NOTIFY_MAIL = true
5657
DISABLE_REGISTRATION = false
5758
ENABLE_CAPTCHA = false

models/action.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,11 @@ func (a *Action) GetBranch() string {
242242
return strings.TrimPrefix(a.RefName, git.BranchPrefix)
243243
}
244244

245+
// GetTag returns the action's repository tag.
246+
func (a *Action) GetTag() string {
247+
return strings.TrimPrefix(a.RefName, git.TagPrefix)
248+
}
249+
245250
// GetContent returns the action's content.
246251
func (a *Action) GetContent() string {
247252
return a.Content

models/commit_status.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ func NewCommitStatus(opts NewCommitStatusOptions) error {
252252

253253
// SignCommitWithStatuses represents a commit with validation of signature and status state.
254254
type SignCommitWithStatuses struct {
255-
Status *CommitStatus
255+
Status *CommitStatus
256+
Statuses []*CommitStatus
256257
*SignCommit
257258
}
258259

@@ -272,6 +273,7 @@ func ParseCommitsWithStatus(oldCommits *list.List, repo *Repository) *list.List
272273
if err != nil {
273274
log.Error("GetLatestCommitStatus: %v", err)
274275
} else {
276+
commit.Statuses = statuses
275277
commit.Status = CalcCommitStatus(statuses)
276278
}
277279

modules/git/repo_tag.go

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,16 @@ func (repo *Repository) CreateAnnotatedTag(name, message, revision string) error
3030
return err
3131
}
3232

33-
func (repo *Repository) getTag(id SHA1) (*Tag, error) {
34-
t, ok := repo.tagCache.Get(id.String())
33+
func (repo *Repository) getTag(tagID SHA1, name string) (*Tag, error) {
34+
t, ok := repo.tagCache.Get(tagID.String())
3535
if ok {
36-
log("Hit cache: %s", id)
36+
log("Hit cache: %s", tagID)
3737
tagClone := *t.(*Tag)
38+
tagClone.Name = name // This is necessary because lightweight tags may have same id
3839
return &tagClone, nil
3940
}
4041

41-
// Get tag name
42-
name, err := repo.GetTagNameBySHA(id.String())
43-
if err != nil {
44-
return nil, err
45-
}
46-
47-
tp, err := repo.GetTagType(id)
42+
tp, err := repo.GetTagType(tagID)
4843
if err != nil {
4944
return nil, err
5045
}
@@ -60,43 +55,28 @@ func (repo *Repository) getTag(id SHA1) (*Tag, error) {
6055
return nil, err
6156
}
6257

63-
// tagID defaults to the commit ID as the tag ID and then tries to get a tag ID (only annotated tags)
64-
tagID := commitID
65-
if tagIDStr, err := repo.GetTagID(name); err != nil {
66-
// if the err is NotExist then we can ignore and just keep tagID as ID (is lightweight tag)
67-
// all other errors we return
68-
if !IsErrNotExist(err) {
69-
return nil, err
70-
}
71-
} else {
72-
tagID, err = NewIDFromString(tagIDStr)
73-
if err != nil {
74-
return nil, err
75-
}
76-
}
77-
7858
// If type is "commit, the tag is a lightweight tag
7959
if ObjectType(tp) == ObjectCommit {
80-
commit, err := repo.GetCommit(id.String())
60+
commit, err := repo.GetCommit(commitIDStr)
8161
if err != nil {
8262
return nil, err
8363
}
8464
tag := &Tag{
8565
Name: name,
8666
ID: tagID,
8767
Object: commitID,
88-
Type: string(ObjectCommit),
68+
Type: tp,
8969
Tagger: commit.Committer,
9070
Message: commit.Message(),
9171
repo: repo,
9272
}
9373

94-
repo.tagCache.Set(id.String(), tag)
74+
repo.tagCache.Set(tagID.String(), tag)
9575
return tag, nil
9676
}
9777

9878
// The tag is an annotated tag with a message.
99-
data, err := NewCommand("cat-file", "-p", id.String()).RunInDirBytes(repo.Path)
79+
data, err := NewCommand("cat-file", "-p", tagID.String()).RunInDirBytes(repo.Path)
10080
if err != nil {
10181
return nil, err
10282
}
@@ -107,11 +87,11 @@ func (repo *Repository) getTag(id SHA1) (*Tag, error) {
10787
}
10888

10989
tag.Name = name
110-
tag.ID = id
90+
tag.ID = tagID
11191
tag.repo = repo
11292
tag.Type = tp
11393

114-
repo.tagCache.Set(id.String(), tag)
94+
repo.tagCache.Set(tagID.String(), tag)
11595
return tag, nil
11696
}
11797

@@ -170,7 +150,7 @@ func (repo *Repository) GetTag(name string) (*Tag, error) {
170150
return nil, err
171151
}
172152

173-
tag, err := repo.getTag(id)
153+
tag, err := repo.getTag(id, name)
174154
if err != nil {
175155
return nil, err
176156
}
@@ -244,7 +224,13 @@ func (repo *Repository) GetAnnotatedTag(sha string) (*Tag, error) {
244224
return nil, ErrNotExist{ID: id.String()}
245225
}
246226

247-
tag, err := repo.getTag(id)
227+
// Get tag name
228+
name, err := repo.GetTagNameBySHA(id.String())
229+
if err != nil {
230+
return nil, err
231+
}
232+
233+
tag, err := repo.getTag(id, name)
248234
if err != nil {
249235
return nil, err
250236
}

modules/setting/service.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var Service struct {
1717
ActiveCodeLives int
1818
ResetPwdCodeLives int
1919
RegisterEmailConfirm bool
20+
RegisterManualConfirm bool
2021
EmailDomainWhitelist []string
2122
DisableRegistration bool
2223
AllowOnlyExternalRegistration bool
@@ -63,6 +64,11 @@ func newService() {
6364
Service.ResetPwdCodeLives = sec.Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180)
6465
Service.DisableRegistration = sec.Key("DISABLE_REGISTRATION").MustBool()
6566
Service.AllowOnlyExternalRegistration = sec.Key("ALLOW_ONLY_EXTERNAL_REGISTRATION").MustBool()
67+
if !sec.Key("REGISTER_EMAIL_CONFIRM").MustBool() {
68+
Service.RegisterManualConfirm = sec.Key("REGISTER_EMAIL_CONFIRM").MustBool(false)
69+
} else {
70+
Service.RegisterManualConfirm = false
71+
}
6672
Service.EmailDomainWhitelist = sec.Key("EMAIL_DOMAIN_WHITELIST").Strings(",")
6773
Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!(Service.DisableRegistration || Service.AllowOnlyExternalRegistration))
6874
Service.ShowMilestonesDashboardPage = sec.Key("SHOW_MILESTONES_DASHBOARD_PAGE").MustBool(true)

options/locale/locale_en-US.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ issues.start_tracking_short = Start
11311131
issues.start_tracking = Start Time Tracking
11321132
issues.start_tracking_history = `started working %s`
11331133
issues.tracker_auto_close = Timer will be stopped automatically when this issue gets closed
1134-
issues.tracking_already_started = `You have already started time tracking on this <a href="%s">issue</a>!`
1134+
issues.tracking_already_started = `You have already started time tracking on <a href="%s">another issue</a>!`
11351135
issues.stop_tracking = Stop
11361136
issues.stop_tracking_history = `stopped working %s`
11371137
issues.add_time = Manually Add Time

options/locale/locale_ja-JP.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,7 @@ diff.whitespace_ignore_all_whitespace=行の比較で空白を無視
17861786
diff.whitespace_ignore_amount_changes=空白の長さの違いは無視
17871787
diff.whitespace_ignore_at_eol=行末の空白の違いは無視
17881788
diff.stats_desc=<strong>%d個のファイルの変更</strong>、<strong>%d行の追加</strong>、<strong>%d行の削除</strong>
1789+
diff.stats_desc_file=変更 %d 行: 追加 %d 行, 削除 %d 行
17891790
diff.bin=バイナリ
17901791
diff.view_file=ファイルの表示
17911792
diff.file_before=変更前

options/locale/locale_zh-CN.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,11 @@ issues.label_templates.info=还没有任何标签。您可以使用'创建标签
988988
issues.label_templates.helper=选择标签模板
989989
issues.label_templates.use=使用标签集
990990
issues.label_templates.fail_to_load_file=加载标签模板文件 '%s' 时发生错误:%v
991-
issues.add_label=已添加 %s 标签 %s
992-
issues.add_labels=已添加 %s 标签 %s
991+
issues.add_label= %s 添加标签 %s
992+
issues.add_labels= %s 添加 %s 标签
993993
issues.remove_label=已删除 %s 标签 %s
994994
issues.remove_labels=已删除 %s 标签 %s
995-
issues.add_remove_labels=已添加 %s 并删除 %s 标签 %s
995+
issues.add_remove_labels= %s 添加标签 %s ,删除标签 %s
996996
issues.add_milestone_at=` %[2]s 添加了里程碑 <b>%[1]s</b>`
997997
issues.add_project_at=`将此添加到 <b>%s</b> 项目 %s`
998998
issues.change_milestone_at=`%[3]s 修改了里程碑从 <b>%[1]s</b> 到 <b>%[2]s</b>`

routers/repo/blame.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ func RefBlame(ctx *context.Context) {
102102
blob := entry.Blob()
103103

104104
ctx.Data["LatestCommitStatus"] = models.CalcCommitStatus(statuses)
105+
ctx.Data["LatestCommitStatuses"] = statuses
105106

106107
ctx.Data["Paths"] = paths
107108
ctx.Data["TreeLink"] = treeLink

routers/repo/commit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ func Diff(ctx *context.Context) {
302302
}
303303

304304
ctx.Data["CommitStatus"] = models.CalcCommitStatus(statuses)
305+
ctx.Data["CommitStatuses"] = statuses
305306

306307
diff, err := gitdiff.GetDiffCommit(repoPath,
307308
commitID, setting.Git.MaxGitDiffLines,

routers/repo/issue.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
259259
return
260260
}
261261

262-
commitStatus[issues[i].PullRequest.ID], _ = pull_service.GetLastCommitStatus(issues[i].PullRequest)
262+
var statuses, _ = pull_service.GetLastCommitStatus(issues[i].PullRequest)
263+
commitStatus[issues[i].PullRequest.ID] = models.CalcCommitStatus(statuses)
263264
}
264265
}
265266

routers/repo/view.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ func renderDirectory(ctx *context.Context, treeLink string) {
359359
}
360360

361361
ctx.Data["LatestCommitStatus"] = models.CalcCommitStatus(statuses)
362+
ctx.Data["LatestCommitStatuses"] = statuses
362363

363364
// Check permission to add or upload new file.
364365
if ctx.Repo.CanWrite(models.UnitTypeCode) && ctx.Repo.IsViewBranch {

routers/user/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ func LinkAccountPostRegister(ctx *context.Context, cpt *captcha.Captcha, form au
949949
Name: form.UserName,
950950
Email: form.Email,
951951
Passwd: form.Password,
952-
IsActive: !setting.Service.RegisterEmailConfirm,
952+
IsActive: !(setting.Service.RegisterEmailConfirm || setting.Service.RegisterManualConfirm),
953953
LoginType: models.LoginOAuth2,
954954
LoginSource: loginSource.ID,
955955
LoginName: gothUser.(goth.User).UserID,
@@ -1144,7 +1144,7 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
11441144
Name: form.UserName,
11451145
Email: form.Email,
11461146
Passwd: form.Password,
1147-
IsActive: !setting.Service.RegisterEmailConfirm,
1147+
IsActive: !(setting.Service.RegisterEmailConfirm || setting.Service.RegisterManualConfirm),
11481148
}
11491149
if err := models.CreateUser(u); err != nil {
11501150
switch {

routers/user/home.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,8 @@ func Issues(ctx *context.Context) {
563563
issue.Repo = showReposMap[issue.RepoID]
564564

565565
if isPullList {
566-
commitStatus[issue.PullRequest.ID], _ = pull_service.GetLastCommitStatus(issue.PullRequest)
566+
var statuses, _ = pull_service.GetLastCommitStatus(issue.PullRequest)
567+
commitStatus[issue.PullRequest.ID] = models.CalcCommitStatus(statuses)
567568
}
568569
}
569570

services/pull/pull.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ func GetSquashMergeCommitMessages(pr *models.PullRequest) string {
628628
return stringBuilder.String()
629629
}
630630

631-
// GetLastCommitStatus returns the last commit status for this pull request.
632-
func GetLastCommitStatus(pr *models.PullRequest) (status *models.CommitStatus, err error) {
631+
// GetLastCommitStatus returns list of commit statuses for latest commit on this pull request.
632+
func GetLastCommitStatus(pr *models.PullRequest) (status []*models.CommitStatus, err error) {
633633
if err = pr.LoadBaseRepo(); err != nil {
634634
return nil, err
635635
}
@@ -654,7 +654,7 @@ func GetLastCommitStatus(pr *models.PullRequest) (status *models.CommitStatus, e
654654
if err != nil {
655655
return nil, err
656656
}
657-
return models.CalcCommitStatus(statusList), nil
657+
return statusList, nil
658658
}
659659

660660
// IsHeadEqualWithBranch returns if the commits of branchName are available in pull request head

0 commit comments

Comments
 (0)