Skip to content

Commit c9ce1cc

Browse files
committed
Fix bug
1 parent 73b1d11 commit c9ce1cc

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

services/pull/review.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -606,15 +606,11 @@ func LoadCodeComments(ctx context.Context, gitRepo *git.Repository, repo *repo_m
606606
hunksCache := make(map[string][]*git.HunkInfo)
607607
// filecomments should be sorted by created time, so that the latest comments are at the end
608608
for _, comment := range fileComments {
609+
if comment.BeforeCommitID == "" {
610+
comment.BeforeCommitID = beforeCommit.ID.String()
611+
}
609612
if comment.CommitSHA == "" {
610-
if comment.Line > 0 {
611-
comment.CommitSHA = afterCommit.ID.String()
612-
} else if comment.Line < 0 {
613-
comment.CommitSHA = beforeCommit.ID.String()
614-
} else {
615-
// If the comment has no line number, we cannot display it in the diff view
616-
continue
617-
}
613+
comment.CommitSHA = afterCommit.ID.String()
618614
}
619615

620616
dstCommitID := beforeCommit.ID.String()

0 commit comments

Comments
 (0)