From a2bd8fe8dc822538f6f606d2a02797b38064718a Mon Sep 17 00:00:00 2001 From: succcubbus <16743652+succcubbus@users.noreply.github.com> Date: Thu, 31 Oct 2019 18:59:36 +0100 Subject: [PATCH] mark review comment as invalidated when file is deleted (#8751) --- models/issue_comment.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/issue_comment.go b/models/issue_comment.go index d7128bdbac..90bb8c53ac 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -444,6 +444,10 @@ func (c *Comment) LoadReview() error { func (c *Comment) checkInvalidation(doer *User, repo *git.Repository, branch string) error { // FIXME differentiate between previous and proposed line commit, err := repo.LineBlame(branch, repo.Path, c.TreePath, uint(c.UnsignedLine())) + if err != nil && strings.Contains(err.Error(), "fatal: no such path") { + c.Invalidated = true + return UpdateComment(c, doer) + } if err != nil { return err }