]> source.dussan.org Git - gitea.git/commitdiff
Fix for #3401 Links of pull request comment email should use pulls URL (#3403)
authorlstahlman <luke.stahlman@gmail.com>
Tue, 9 Aug 2016 05:40:05 +0000 (22:40 -0700)
committer无闻 <u@gogs.io>
Tue, 9 Aug 2016 05:40:05 +0000 (22:40 -0700)
models/issue.go

index 4a6f9b278aa4708e044a0b7edb486c315f3253e0..b142a5de7cace005cd8f3c8af1b912c7e2e58e38 100644 (file)
@@ -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.