summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-02-11 12:00:29 +0800
committerGitHub <noreply@github.com>2017-02-11 12:00:29 +0800
commitcf0f451c37496c84795e98191a20350e0f5be35c (patch)
treecea8b11a1a9afbf29f828c6132dc19c07c741bdc /models/issue.go
parent3576e1ee739cc03f87e6ce98dbef2f32b517b202 (diff)
downloadgitea-cf0f451c37496c84795e98191a20350e0f5be35c.tar.gz
gitea-cf0f451c37496c84795e98191a20350e0f5be35c.zip
Add delete branch track on pull request comments (#888)
* add delete branch track on pull request comments * don't change vendor
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index 48d845e6e8..c3f5de6429 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -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