summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlstahlman <luke.stahlman@gmail.com>2016-08-08 22:40:05 -0700
committer无闻 <u@gogs.io>2016-08-08 22:40:05 -0700
commit699c71d319138b326bcb4fdf8e6eeac03c82e5b9 (patch)
treedf3627310f565f225a04c6b761eee930b0e29758
parent21f25799b4f28455e3ac3a77950deb6520d98dab (diff)
downloadgitea-699c71d319138b326bcb4fdf8e6eeac03c82e5b9.tar.gz
gitea-699c71d319138b326bcb4fdf8e6eeac03c82e5b9.zip
Fix for #3401 Links of pull request comment email should use pulls URL (#3403)
-rw-r--r--models/issue.go8
1 files changed, 7 insertions, 1 deletions
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.