@@ -714,11 +714,6 @@ func updateIssueCols(e Engine, issue *Issue, cols ...string) error {
714
714
return nil
715
715
}
716
716
717
- // UpdateIssueCols only updates values of specific columns for given issue.
718
- func UpdateIssueCols (issue * Issue , cols ... string ) error {
719
- return updateIssueCols (x , issue , cols ... )
720
- }
721
-
722
717
func (issue * Issue ) changeStatus (e * xorm.Session , doer * User , isClosed bool ) (err error ) {
723
718
// Reload the issue
724
719
currentIssue , err := getIssueByID (e , issue .ID )
@@ -844,9 +839,7 @@ func (issue *Issue) ChangeStatus(doer *User, isClosed bool) (err error) {
844
839
}
845
840
846
841
// ChangeTitle changes the title of this issue, as the given user.
847
- func (issue * Issue ) ChangeTitle (doer * User , title string ) (err error ) {
848
- oldTitle := issue .Title
849
- issue .Title = title
842
+ func (issue * Issue ) ChangeTitle (doer * User , oldTitle string ) (err error ) {
850
843
sess := x .NewSession ()
851
844
defer sess .Close ()
852
845
@@ -862,7 +855,7 @@ func (issue *Issue) ChangeTitle(doer *User, title string) (err error) {
862
855
return fmt .Errorf ("loadRepo: %v" , err )
863
856
}
864
857
865
- if _ , err = createChangeTitleComment (sess , doer , issue .Repo , issue , oldTitle , title ); err != nil {
858
+ if _ , err = createChangeTitleComment (sess , doer , issue .Repo , issue , oldTitle , issue . Title ); err != nil {
866
859
return fmt .Errorf ("createChangeTitleComment: %v" , err )
867
860
}
868
861
@@ -874,51 +867,7 @@ func (issue *Issue) ChangeTitle(doer *User, title string) (err error) {
874
867
return err
875
868
}
876
869
877
- if err = sess .Commit (); err != nil {
878
- return err
879
- }
880
- sess .Close ()
881
-
882
- mode , _ := AccessLevel (issue .Poster , issue .Repo )
883
- if issue .IsPull {
884
- if err = issue .loadPullRequest (sess ); err != nil {
885
- return fmt .Errorf ("loadPullRequest: %v" , err )
886
- }
887
- issue .PullRequest .Issue = issue
888
- err = PrepareWebhooks (issue .Repo , HookEventPullRequest , & api.PullRequestPayload {
889
- Action : api .HookIssueEdited ,
890
- Index : issue .Index ,
891
- Changes : & api.ChangesPayload {
892
- Title : & api.ChangesFromPayload {
893
- From : oldTitle ,
894
- },
895
- },
896
- PullRequest : issue .PullRequest .APIFormat (),
897
- Repository : issue .Repo .APIFormat (mode ),
898
- Sender : doer .APIFormat (),
899
- })
900
- } else {
901
- err = PrepareWebhooks (issue .Repo , HookEventIssues , & api.IssuePayload {
902
- Action : api .HookIssueEdited ,
903
- Index : issue .Index ,
904
- Changes : & api.ChangesPayload {
905
- Title : & api.ChangesFromPayload {
906
- From : oldTitle ,
907
- },
908
- },
909
- Issue : issue .APIFormat (),
910
- Repository : issue .Repo .APIFormat (mode ),
911
- Sender : issue .Poster .APIFormat (),
912
- })
913
- }
914
-
915
- if err != nil {
916
- log .Error ("PrepareWebhooks [is_pull: %v]: %v" , issue .IsPull , err )
917
- } else {
918
- go HookQueue .Add (issue .RepoID )
919
- }
920
-
921
- return nil
870
+ return sess .Commit ()
922
871
}
923
872
924
873
// AddDeletePRBranchComment adds delete branch comment for pull request issue
0 commit comments