Skip to content

Commit 049af0d

Browse files
authored
Fix branch page pull request title and link error (#10092) (#10097)
* Fix branch page pull request title and link error (#10092)
1 parent f5727d8 commit 049af0d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

routers/repo/branch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ func loadBranches(ctx *context.Context) []*Branch {
238238
} else {
239239
repoIDToRepo[pr.BaseRepoID] = pr.BaseRepo
240240
}
241+
pr.Issue.Repo = pr.BaseRepo
241242

242243
if pr.HasMerged {
243244
baseGitRepo, ok := repoIDToGitRepo[pr.BaseRepoID]
@@ -260,7 +261,6 @@ func loadBranches(ctx *context.Context) []*Branch {
260261
mergeMovedOn = true
261262
}
262263
}
263-
264264
}
265265

266266
isIncluded := divergence.Ahead == 0 && ctx.Repo.Repository.DefaultBranch != branchName

templates/repo/branch/list.tmpl

+5-5
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</div>
7474
{{end}}
7575
</td>
76-
<td class="two wide right aligned">
76+
<td class="three wide right aligned">
7777
{{if not .LatestPullRequest}}
7878
{{if .IsIncluded}}
7979
<a class="ui poping up orange small label" data-content="{{$.i18n.Tr "repo.branch.included_desc"}}" data-variation="tiny inverted" data-position="top right">
@@ -91,13 +91,13 @@
9191
</a>
9292
{{end}}
9393
{{else}}
94-
<a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}">#{{.LatestPullRequest.Issue.Index}}</a>
94+
<a href="{{.LatestPullRequest.Issue.HTMLURL}}">{{if ne .LatestPullRequest.BaseRepoID .LatestPullRequest.HeadRepoID}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}}</a>
9595
{{if .LatestPullRequest.HasMerged}}
96-
<a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}" class="ui purple small label"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.merged"}}</a>
96+
<a href="{{.LatestPullRequest.Issue.HTMLURL}}" class="ui purple mini label"><i class="octicon octicon-git-pull-request"></i> {{$.i18n.Tr "repo.pulls.merged"}}</a>
9797
{{else if .LatestPullRequest.Issue.IsClosed}}
98-
<a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}" class="ui red small label"><i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.closed_title"}}</a>
98+
<a href="{{.LatestPullRequest.Issue.HTMLURL}}" class="ui red mini label"><i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.closed_title"}}</a>
9999
{{else}}
100-
<a href="{{$.RepoLink}}/pulls/{{.LatestPullRequest.Issue.Index}}" class="ui green small label"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_title"}}</a>
100+
<a href="{{.LatestPullRequest.Issue.HTMLURL}}" class="ui green mini label"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_title"}}</a>
101101
{{end}}
102102
{{end}}
103103
</td>

0 commit comments

Comments
 (0)