mirror of
https://github.com/go-gitea/gitea
synced 2024-12-23 09:27:55 +01:00
Don't attempt to close issue if already closed (#9699)
This commit is contained in:
parent
a516a7ba0f
commit
ff16099c6d
@ -137,12 +137,14 @@ func UpdateIssuesCommit(doer *models.User, repo *models.Repository, commits []*m
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close := (ref.Action == references.XRefActionCloses)
|
||||||
if err := changeIssueStatus(refRepo, refIssue, doer, ref.Action == references.XRefActionCloses); err != nil {
|
if close != refIssue.IsClosed {
|
||||||
|
if err := changeIssueStatus(refRepo, refIssue, doer, close); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,10 +374,12 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
close := (ref.RefAction == references.XRefActionCloses)
|
close := (ref.RefAction == references.XRefActionCloses)
|
||||||
|
if close != ref.Issue.IsClosed {
|
||||||
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
|
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user