Skip to content

Commit 648c479

Browse files
committed
Fix bug
1 parent 507e974 commit 648c479

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
@@ -541,15 +541,11 @@ func FetchCodeCommentsByLine(ctx context.Context, gitRepo *git.Repository, repo
541541
hunksCache := make(map[string][]*git.HunkInfo)
542542
for _, comment := range comments {
543543
// Code comment should always have a commit SHA, if not, we need to set it based on the line number
544+
if comment.BeforeCommitID == "" {
545+
comment.BeforeCommitID = beforeCommitID
546+
}
544547
if comment.CommitSHA == "" {
545-
if comment.Line > 0 {
546-
comment.CommitSHA = afterCommitID
547-
} else if comment.Line < 0 {
548-
comment.CommitSHA = beforeCommitID
549-
} else {
550-
// If the comment has no line number, we cannot display it in the diff view
551-
continue
552-
}
548+
comment.CommitSHA = afterCommitID
553549
}
554550

555551
dstCommitID := beforeCommitID

0 commit comments

Comments
 (0)