mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-09-07 07:03:21 +00:00
mark review comment as invalidated when file is deleted (#8751)
This commit is contained in:
parent
cb1048d780
commit
a2bd8fe8dc
1 changed files with 4 additions and 0 deletions
|
@ -444,6 +444,10 @@ func (c *Comment) LoadReview() error {
|
||||||
func (c *Comment) checkInvalidation(doer *User, repo *git.Repository, branch string) error {
|
func (c *Comment) checkInvalidation(doer *User, repo *git.Repository, branch string) error {
|
||||||
// FIXME differentiate between previous and proposed line
|
// FIXME differentiate between previous and proposed line
|
||||||
commit, err := repo.LineBlame(branch, repo.Path, c.TreePath, uint(c.UnsignedLine()))
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue