From: lstahlman Date: Tue, 9 Aug 2016 05:40:05 +0000 (-0700) Subject: Fix for #3401 Links of pull request comment email should use pulls URL (#3403) X-Git-Tag: v0.9.99~151 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=699c71d319138b326bcb4fdf8e6eeac03c82e5b9;p=gitea.git Fix for #3401 Links of pull request comment email should use pulls URL (#3403) --- diff --git a/models/issue.go b/models/issue.go index 4a6f9b278a..b142a5de7c 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.