From 2343feadd434561d86b1273792d88f609a782114 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 1 Dec 2016 18:51:50 +0800 Subject: [PATCH] resolved #310: hide fork to self (#323) --- routers/repo/pull.go | 1 + templates/repo/pulls/fork.tmpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 389fcb0898..5e51fda495 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -62,6 +62,7 @@ func getForkRepository(ctx *context.Context) *models.Repository { return nil } ctx.Data["ForkFrom"] = forkRepo.Owner.Name + "/" + forkRepo.Name + ctx.Data["ForkFromOwnerID"] = forkRepo.Owner.ID if err := ctx.User.GetOrganizations(true); err != nil { ctx.Handle(500, "GetOrganizations", err) diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl index 431f6df236..133cc92f7c 100644 --- a/templates/repo/pulls/fork.tmpl +++ b/templates/repo/pulls/fork.tmpl @@ -24,7 +24,7 @@ {{.SignedUser.ShortName 20}} {{range .Orgs}} - {{if .IsOwnedBy $.SignedUser.ID}} + {{if and (.IsOwnedBy $.SignedUser.ID) (ne .ID $.ForkFromOwnerID)}}
{{.ShortName 20}}