diff options
author | Brad Albright <32200834+bhalbright@users.noreply.github.com> | 2020-01-21 04:18:52 -0600 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2020-01-21 10:18:52 +0000 |
commit | 2f7a747e4f3ace73c6bd475f2415e6ed06431e49 (patch) | |
tree | 15fe1d8c4efcb039f8938be55b2fc8cabee78ffd /models/issue_comment_list.go | |
parent | 5cf241b3123a6096076a9cb582d28fb8919969e0 (diff) | |
download | gitea-2f7a747e4f3ace73c6bd475f2415e6ed06431e49.tar.gz gitea-2f7a747e4f3ace73c6bd475f2415e6ed06431e49.zip |
Fixed repo link in generated comment for cross repository dependency (#9863)
* fixed link to issue in issue comments after adding/removing a dependency, before links assumed the issue was in the same repository. also changed the format of the displayed issue since the issue will not necessarily be in the same repo
* based on pr comments, changed to use HTMLURL instead of piecing together the issue url, and added an if statement around the issue link display as a nil protection
* only showing repo name in dependency comment if the issue is from another repo
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to 'models/issue_comment_list.go')
-rw-r--r-- | models/issue_comment_list.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/models/issue_comment_list.go b/models/issue_comment_list.go index ae2a89a01a..f8739e32a6 100644 --- a/models/issue_comment_list.go +++ b/models/issue_comment_list.go @@ -376,6 +376,11 @@ func (comments CommentList) loadDependentIssues(e Engine) error { for _, comment := range comments { if comment.DependentIssue == nil { comment.DependentIssue = issues[comment.DependentIssueID] + if comment.DependentIssue != nil { + if err := comment.DependentIssue.loadRepo(e); err != nil { + return err + } + } } } return nil |