Skip to content

Commit 2343fea

Browse files
authored
resolved #310: hide fork to self (#323)
1 parent 31950cb commit 2343fea

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

routers/repo/pull.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func getForkRepository(ctx *context.Context) *models.Repository {
6262
return nil
6363
}
6464
ctx.Data["ForkFrom"] = forkRepo.Owner.Name + "/" + forkRepo.Name
65+
ctx.Data["ForkFromOwnerID"] = forkRepo.Owner.ID
6566

6667
if err := ctx.User.GetOrganizations(true); err != nil {
6768
ctx.Handle(500, "GetOrganizations", err)

templates/repo/pulls/fork.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{{.SignedUser.ShortName 20}}
2525
</div>
2626
{{range .Orgs}}
27-
{{if .IsOwnedBy $.SignedUser.ID}}
27+
{{if and (.IsOwnedBy $.SignedUser.ID) (ne .ID $.ForkFromOwnerID)}}
2828
<div class="item" data-value="{{.ID}}">
2929
<img class="ui mini image" src="{{.RelAvatarLink}}">
3030
{{.ShortName 20}}

0 commit comments

Comments
 (0)