@@ -86,16 +86,14 @@ type DiffLine struct {
8686
8787// DiffLineSectionInfo represents diff line section meta data
8888type DiffLineSectionInfo struct {
89- Path string
90- LastLeftIdx int
91- LastRightIdx int
92- LeftIdx int
93- RightIdx int
94- LeftHunkSize int
95- RightHunkSize int
96- HasComments bool
97- LastRightCommentIdx int
98- RightCommentIdx int
89+ Path string
90+ LastLeftIdx int
91+ LastRightIdx int
92+ LeftIdx int
93+ RightIdx int
94+ LeftHunkSize int
95+ RightHunkSize int
96+ HasComments bool
9997}
10098
10199// BlobExcerptChunkSize represent max lines of excerpt
@@ -146,12 +144,10 @@ func (d *DiffLine) GetBlobExcerptQuery() string {
146144 "last_left=%d&last_right=%d&" +
147145 "left=%d&right=%d&" +
148146 "left_hunk_size=%d&right_hunk_size=%d&" +
149- "last_rightt_comment_idx=%d&right_comment_idx=%d&" +
150147 "path=%s" ,
151148 d .SectionInfo .LastLeftIdx , d .SectionInfo .LastRightIdx ,
152149 d .SectionInfo .LeftIdx , d .SectionInfo .RightIdx ,
153150 d .SectionInfo .LeftHunkSize , d .SectionInfo .RightHunkSize ,
154- d .SectionInfo .LastRightCommentIdx , d .SectionInfo .RightCommentIdx ,
155151 url .QueryEscape (d .SectionInfo .Path ))
156152 return query
157153}
@@ -175,16 +171,14 @@ func getDiffLineSectionInfo(treePath, line string, lastLeftIdx, lastRightIdx int
175171 leftLine , leftHunk , rightLine , righHunk := git .ParseDiffHunkString (line )
176172
177173 return & DiffLineSectionInfo {
178- Path : treePath ,
179- LastLeftIdx : lastLeftIdx ,
180- LastRightIdx : lastRightIdx ,
181- LeftIdx : leftLine ,
182- RightIdx : rightLine ,
183- LeftHunkSize : leftHunk ,
184- RightHunkSize : righHunk ,
185- HasComments : false ,
186- LastRightCommentIdx : 0 ,
187- RightCommentIdx : 0 ,
174+ Path : treePath ,
175+ LastLeftIdx : lastLeftIdx ,
176+ LastRightIdx : lastRightIdx ,
177+ LeftIdx : leftLine ,
178+ RightIdx : rightLine ,
179+ LeftHunkSize : leftHunk ,
180+ RightHunkSize : righHunk ,
181+ HasComments : false ,
188182 }
189183}
190184
@@ -404,14 +398,12 @@ func (diffFile *DiffFile) GetTailSection(gitRepo *git.Repository, leftCommit, ri
404398 Type : DiffLineSection ,
405399 Content : " " ,
406400 SectionInfo : & DiffLineSectionInfo {
407- Path : diffFile .Name ,
408- LastLeftIdx : lastLine .LeftIdx ,
409- LastRightIdx : lastLine .RightIdx ,
410- LeftIdx : leftLineCount ,
411- RightIdx : rightLineCount ,
412- HasComments : false ,
413- LastRightCommentIdx : 0 ,
414- RightCommentIdx : 0 ,
401+ Path : diffFile .Name ,
402+ LastLeftIdx : lastLine .LeftIdx ,
403+ LastRightIdx : lastLine .RightIdx ,
404+ LeftIdx : leftLineCount ,
405+ RightIdx : rightLineCount ,
406+ HasComments : false ,
415407 },
416408 }
417409 tailSection := & DiffSection {FileName : diffFile .Name , Lines : []* DiffLine {tailDiffLine }}
@@ -469,11 +461,9 @@ type Diff struct {
469461 NumViewedFiles int // user-specific
470462}
471463
472- // function (section *DiffSection) GetType() int {
473-
474464// LoadComments loads comments into each line
475465func (diff * Diff ) LoadComments (ctx context.Context , issue * issues_model.Issue , currentUser * user_model.User , showOutdatedComments bool ) error {
476- allComments , err := issues_model .FetchCodeComments (ctx , issue , currentUser , showOutdatedComments )
466+ allComments , err := issues_model .FetchCodeComments (ctx , issue , currentUser , showOutdatedComments , nil )
477467 if err != nil {
478468 return err
479469 }
0 commit comments