mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 20:17:21 +00:00
Add delete branch track on pull request comments (#888)
* add delete branch track on pull request comments * don't change vendor
This commit is contained in:
@ -685,6 +685,24 @@ func (issue *Issue) ChangeTitle(doer *User, title string) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddDeletePRBranchComment adds delete branch comment for pull request issue
|
||||
func AddDeletePRBranchComment(doer *User, repo *Repository, issueID int64, branchName string) error {
|
||||
issue, err := getIssueByID(x, issueID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
if err := sess.Begin(); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := createDeleteBranchComment(sess, doer, repo, issue, branchName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
// ChangeContent changes issue content, as the given user.
|
||||
func (issue *Issue) ChangeContent(doer *User, content string) (err error) {
|
||||
oldContent := issue.Content
|
||||
|
Reference in New Issue
Block a user