Skip to content

Commit a2bd8fe

Browse files
iyzanatechknowlogick
authored andcommitted
mark review comment as invalidated when file is deleted (#8751)
1 parent cb1048d commit a2bd8fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/issue_comment.go

+4
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,10 @@ func (c *Comment) LoadReview() error {
444444
func (c *Comment) checkInvalidation(doer *User, repo *git.Repository, branch string) error {
445445
// FIXME differentiate between previous and proposed line
446446
commit, err := repo.LineBlame(branch, repo.Path, c.TreePath, uint(c.UnsignedLine()))
447+
if err != nil && strings.Contains(err.Error(), "fatal: no such path") {
448+
c.Invalidated = true
449+
return UpdateComment(c, doer)
450+
}
447451
if err != nil {
448452
return err
449453
}

0 commit comments

Comments
 (0)