Skip to content

Commit

Permalink
Make compare button URL aware if current repo is a fork (#2162) (#2163)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Weyzu authored and lunny committed Jul 15, 2017
1 parent 98c5a1e commit 32f289a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/repo/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="ui secondary menu">
{{if .PullRequestCtx.Allowed}}
<div class="fitted item">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.SignedUser.Name}}:{{.BranchName}}">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{if .SignedUser.HasForkedRepo .BaseRepo.ID }}{{.SignedUser.Name}}:{{end}}{{.BranchName}}">
<button class="ui green small button"><i class="octicon octicon-git-compare"></i></button>
</a>
</div>
Expand Down

0 comments on commit 32f289a

Please sign in to comment.