summaryrefslogtreecommitdiffstats
path: root/models/issue_comment.go
diff options
context:
space:
mode:
authorsucccubbus <16743652+succcubbus@users.noreply.github.com>2019-10-31 18:59:36 +0100
committertechknowlogick <techknowlogick@gitea.io>2019-10-31 13:59:36 -0400
commita2bd8fe8dc822538f6f606d2a02797b38064718a (patch)
tree855ac250e83b8c08574c537f2358ca19556d8197 /models/issue_comment.go
parentcb1048d7801d1fd9e2d3551861e6e4a750671f87 (diff)
downloadgitea-a2bd8fe8dc822538f6f606d2a02797b38064718a.tar.gz
gitea-a2bd8fe8dc822538f6f606d2a02797b38064718a.zip
mark review comment as invalidated when file is deleted (#8751)
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r--models/issue_comment.go4
1 files changed, 4 insertions, 0 deletions
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
}