@@ -17,7 +17,6 @@ import (
1717 system_model "code.gitea.io/gitea/models/system"
1818 "code.gitea.io/gitea/models/unit"
1919 user_model "code.gitea.io/gitea/models/user"
20- "code.gitea.io/gitea/modules/git"
2120 "code.gitea.io/gitea/modules/references"
2221 api "code.gitea.io/gitea/modules/structs"
2322 "code.gitea.io/gitea/modules/timeutil"
@@ -166,39 +165,6 @@ func ChangeIssueTitle(ctx context.Context, issue *Issue, doer *user_model.User,
166165 return committer .Commit ()
167166}
168167
169- // ChangeIssueRef changes the branch of this issue, as the given user.
170- func ChangeIssueRef (ctx context.Context , issue * Issue , doer * user_model.User , oldRef string ) (err error ) {
171- ctx , committer , err := db .TxContext (ctx )
172- if err != nil {
173- return err
174- }
175- defer committer .Close ()
176-
177- if err = UpdateIssueCols (ctx , issue , "ref" ); err != nil {
178- return fmt .Errorf ("updateIssueCols: %w" , err )
179- }
180-
181- if err = issue .LoadRepo (ctx ); err != nil {
182- return fmt .Errorf ("loadRepo: %w" , err )
183- }
184- oldRefFriendly := strings .TrimPrefix (oldRef , git .BranchPrefix )
185- newRefFriendly := strings .TrimPrefix (issue .Ref , git .BranchPrefix )
186-
187- opts := & CreateCommentOptions {
188- Type : CommentTypeChangeIssueRef ,
189- Doer : doer ,
190- Repo : issue .Repo ,
191- Issue : issue ,
192- OldRef : oldRefFriendly ,
193- NewRef : newRefFriendly ,
194- }
195- if _ , err = CreateComment (ctx , opts ); err != nil {
196- return fmt .Errorf ("createComment: %w" , err )
197- }
198-
199- return committer .Commit ()
200- }
201-
202168// AddDeletePRBranchComment adds delete branch comment for pull request issue
203169func AddDeletePRBranchComment (ctx context.Context , doer * user_model.User , repo * repo_model.Repository , issueID int64 , branchName string ) error {
204170 issue , err := GetIssueByID (ctx , issueID )
0 commit comments