Skip to content

Commit 0b77dbc

Browse files
ethantkoeniglunny
authored andcommitted
Fix new pull request link (#3133)
* Fix new pull request link * Only show button for branches
1 parent e693fda commit 0b77dbc

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

modules/context/repo.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ func RepoAssignment() macaron.Handler {
427427
return
428428
}
429429
}
430-
ctx.Data["IsForkedRepo"] = repo.IsFork
431430

432431
// People who have push access or have forked repository can propose a new pull request.
433432
if ctx.Repo.IsWriter() || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID)) {

templates/repo/home.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
</div>
2626
{{template "repo/sub_menu" .}}
2727
<div class="ui secondary menu">
28-
{{if .PullRequestCtx.Allowed}}
28+
{{if and .PullRequestCtx.Allowed .IsViewBranch}}
2929
<div class="fitted item">
30-
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{if .IsForkedRepo}}{{.Repository.Owner.Name}}:{{else}}{{if .SignedUser.HasForkedRepo .BaseRepo.ID}}{{.SignedUser.Name}}:{{end}}{{end}}{{.BranchName}}">
30+
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.Repository.Owner.Name}}:{{.BranchName}}">
3131
<button class="ui green tiny compact button"><i class="octicon octicon-git-compare"></i></button>
3232
</a>
3333
</div>

0 commit comments

Comments
 (0)