瀏覽代碼

Fix for #3401 Links of pull request comment email should use pulls URL (#3403)

lstahlman 7 年之前
父節點
當前提交
699c71d319
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      models/issue.go

+ 7 - 1
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.