fix IsPullReuqestBroken->IsPullRequestBroken (#4578)

Signed-off-by: Julien Tant <julien@craftyx.fr>
tokarchuk/v1.17
Julien Tant 6 years ago committed by Lunny Xiao
parent d57233680b
commit ced08d18a4
  1. 6
      routers/repo/pull.go
  2. 4
      templates/repo/issue/view_content/pull.tmpl

@ -264,7 +264,7 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *models.Issue) *git.P
if err != nil { if err != nil {
if strings.Contains(err.Error(), "fatal: Not a valid object name") { if strings.Contains(err.Error(), "fatal: Not a valid object name") {
ctx.Data["IsPullReuqestBroken"] = true ctx.Data["IsPullRequestBroken"] = true
ctx.Data["BaseTarget"] = "deleted" ctx.Data["BaseTarget"] = "deleted"
ctx.Data["NumCommits"] = 0 ctx.Data["NumCommits"] = 0
ctx.Data["NumFiles"] = 0 ctx.Data["NumFiles"] = 0
@ -302,7 +302,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.PullReq
} }
if pull.HeadRepo == nil || !headGitRepo.IsBranchExist(pull.HeadBranch) { if pull.HeadRepo == nil || !headGitRepo.IsBranchExist(pull.HeadBranch) {
ctx.Data["IsPullReuqestBroken"] = true ctx.Data["IsPullRequestBroken"] = true
ctx.Data["HeadTarget"] = "deleted" ctx.Data["HeadTarget"] = "deleted"
ctx.Data["NumCommits"] = 0 ctx.Data["NumCommits"] = 0
ctx.Data["NumFiles"] = 0 ctx.Data["NumFiles"] = 0
@ -313,7 +313,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.PullReq
pull.BaseBranch, pull.HeadBranch) pull.BaseBranch, pull.HeadBranch)
if err != nil { if err != nil {
if strings.Contains(err.Error(), "fatal: Not a valid object name") { if strings.Contains(err.Error(), "fatal: Not a valid object name") {
ctx.Data["IsPullReuqestBroken"] = true ctx.Data["IsPullRequestBroken"] = true
ctx.Data["BaseTarget"] = "deleted" ctx.Data["BaseTarget"] = "deleted"
ctx.Data["NumCommits"] = 0 ctx.Data["NumCommits"] = 0
ctx.Data["NumFiles"] = 0 ctx.Data["NumFiles"] = 0

@ -2,7 +2,7 @@
<a class="avatar text <a class="avatar text
{{if .Issue.PullRequest.HasMerged}}purple {{if .Issue.PullRequest.HasMerged}}purple
{{else if .Issue.IsClosed}}grey {{else if .Issue.IsClosed}}grey
{{else if .IsPullReuqestBroken}}red {{else if .IsPullRequestBroken}}red
{{else if .Issue.PullRequest.IsChecking}}yellow {{else if .Issue.PullRequest.IsChecking}}yellow
{{else if .Issue.PullRequest.CanAutoMerge}}green {{else if .Issue.PullRequest.CanAutoMerge}}green
{{else}}red{{end}}"><span class="mega-octicon octicon-git-merge"></span></a> {{else}}red{{end}}"><span class="mega-octicon octicon-git-merge"></span></a>
@ -22,7 +22,7 @@
<div class="item text grey"> <div class="item text grey">
{{$.i18n.Tr "repo.pulls.reopen_to_merge"}} {{$.i18n.Tr "repo.pulls.reopen_to_merge"}}
</div> </div>
{{else if .IsPullReuqestBroken}} {{else if .IsPullRequestBroken}}
<div class="item text red"> <div class="item text red">
<span class="octicon octicon-x"></span> <span class="octicon octicon-x"></span>
{{$.i18n.Tr "repo.pulls.data_broken"}} {{$.i18n.Tr "repo.pulls.data_broken"}}

Loading…
Cancel
Save