From 699c71d319138b326bcb4fdf8e6eeac03c82e5b9 Mon Sep 17 00:00:00 2001 From: lstahlman Date: Mon, 8 Aug 2016 22:40:05 -0700 Subject: [PATCH] Fix for #3401 Links of pull request comment email should use pulls URL (#3403) --- models/issue.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/models/issue.go b/models/issue.go index 4a6f9b27..b142a5de 100644 --- a/models/issue.go +++ b/models/issue.go @@ -160,7 +160,13 @@ func (i *Issue) State() string { } func (issue *Issue) FullLink() string { - return fmt.Sprintf("%s/issues/%d", issue.Repo.FullLink(), issue.Index) + var path string + if issue.IsPull { + path = "pulls" + } else { + path = "issues" + } + return fmt.Sprintf("%s/%s/%d", issue.Repo.FullLink(), path, issue.Index) } // IsPoster returns true if given user by ID is the poster.