Skip to content

Commit 32f289a

Browse files
Weyzulunny
authored andcommitted
Make compare button URL aware if current repo is a fork (#2162) (#2163)
* Make compare button URL aware if current repo is a fork (#2162) * Optimize code * To not change current behaviour check if signed in user has fork of base repository * Fix to check only if signed user has forked repo otherwise it will still redirect to wrong page
1 parent 98c5a1e commit 32f289a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/repo/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="ui secondary menu">
1111
{{if .PullRequestCtx.Allowed}}
1212
<div class="fitted item">
13-
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.SignedUser.Name}}:{{.BranchName}}">
13+
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{if .SignedUser.HasForkedRepo .BaseRepo.ID }}{{.SignedUser.Name}}:{{end}}{{.BranchName}}">
1414
<button class="ui green small button"><i class="octicon octicon-git-compare"></i></button>
1515
</a>
1616
</div>

0 commit comments

Comments
 (0)