Skip to content

Commit 7884353

Browse files
gdutyifeilafriks
authored andcommitted
Add the Owner Name to differentiate when merging (#3807)
1 parent baffea1 commit 7884353

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

routers/repo/pull.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,10 @@ func ParseCompareInfo(ctx *context.Context) (*models.User, *models.Repository, *
692692
if isSameRepo {
693693
headRepo = ctx.Repo.Repository
694694
headGitRepo = ctx.Repo.GitRepo
695+
ctx.Data["BaseName"] = headUser.Name
695696
} else {
696697
headGitRepo, err = git.OpenRepository(models.RepoPath(headUser.Name, headRepo.Name))
698+
ctx.Data["BaseName"] = baseRepo.OwnerName
697699
if err != nil {
698700
ctx.ServerError("OpenRepository", err)
699701
return nil, nil, nil, nil, "", ""

templates/repo/pulls/compare.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<span class="octicon octicon-git-compare"></span>
1212
<div class="ui floating filter dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}">
1313
<div class="ui basic small button">
14-
<span class="text">{{.i18n.Tr "repo.pulls.compare_base"}}: {{$.BaseBranch}}</span>
14+
<span class="text">{{.i18n.Tr "repo.pulls.compare_base"}}: {{$.BaseName}}:{{$.BaseBranch}}</span>
1515
<i class="dropdown icon"></i>
1616
</div>
1717
<div class="menu">
@@ -21,15 +21,15 @@
2121
</div>
2222
<div class="scrolling menu">
2323
{{range .Branches}}
24-
<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-url="{{$.RepoLink}}/compare/{{EscapePound .}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}:{{end}}{{EscapePound $.HeadBranch}}">{{.}}</div>
24+
<div class="item {{if eq $.BaseBranch .}}selected{{end}}" data-url="{{$.RepoLink}}/compare/{{EscapePound .}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}:{{end}}{{EscapePound $.HeadBranch}}">{{$.BaseName}}:{{.}}</div>
2525
{{end}}
2626
</div>
2727
</div>
2828
</div>
2929
...
3030
<div class="ui floating filter dropdown">
3131
<div class="ui basic small button">
32-
<span class="text">{{.i18n.Tr "repo.pulls.compare_compare"}}: {{$.HeadBranch}}</span>
32+
<span class="text">{{.i18n.Tr "repo.pulls.compare_compare"}}: {{$.HeadUser.Name}}:{{$.HeadBranch}}</span>
3333
<i class="dropdown icon"></i>
3434
</div>
3535
<div class="menu">
@@ -39,7 +39,7 @@
3939
</div>
4040
<div class="scrolling menu">
4141
{{range .HeadBranches}}
42-
<div class="{{if eq $.HeadBranch .}}selected{{end}} item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}:{{end}}{{EscapePound .}}">{{.}}</div>
42+
<div class="{{if eq $.HeadBranch .}}selected{{end}} item" data-url="{{$.RepoLink}}/compare/{{EscapePound $.BaseBranch}}...{{if not $.PullRequestCtx.SameRepo}}{{$.HeadUser.Name}}:{{end}}{{EscapePound .}}">{{$.HeadUser.Name}}:{{.}}</div>
4343
{{end}}
4444
</div>
4545
</div>

0 commit comments

Comments
 (0)