mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-28 23:09:24 +00:00
Fix bug
This commit is contained in:
parent
73b1d11a04
commit
c9ce1cc640
@ -606,15 +606,11 @@ func LoadCodeComments(ctx context.Context, gitRepo *git.Repository, repo *repo_m
|
|||||||
hunksCache := make(map[string][]*git.HunkInfo)
|
hunksCache := make(map[string][]*git.HunkInfo)
|
||||||
// filecomments should be sorted by created time, so that the latest comments are at the end
|
// filecomments should be sorted by created time, so that the latest comments are at the end
|
||||||
for _, comment := range fileComments {
|
for _, comment := range fileComments {
|
||||||
|
if comment.BeforeCommitID == "" {
|
||||||
|
comment.BeforeCommitID = beforeCommit.ID.String()
|
||||||
|
}
|
||||||
if comment.CommitSHA == "" {
|
if comment.CommitSHA == "" {
|
||||||
if comment.Line > 0 {
|
comment.CommitSHA = afterCommit.ID.String()
|
||||||
comment.CommitSHA = afterCommit.ID.String()
|
|
||||||
} else if comment.Line < 0 {
|
|
||||||
comment.CommitSHA = beforeCommit.ID.String()
|
|
||||||
} else {
|
|
||||||
// If the comment has no line number, we cannot display it in the diff view
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dstCommitID := beforeCommit.ID.String()
|
dstCommitID := beforeCommit.ID.String()
|
||||||
|
Loading…
Reference in New Issue
Block a user