Skip to content

Commit

Permalink
mark review comment as invalidated when file is deleted (#8751)
Browse files Browse the repository at this point in the history
  • Loading branch information
iyzana authored and techknowlogick committed Oct 31, 2019
1 parent cb1048d commit a2bd8fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/issue_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a2bd8fe

Please sign in to comment.