@@ -21,6 +21,7 @@ import (
21
21
"code.gitea.io/gitea/modules/git"
22
22
"code.gitea.io/gitea/modules/log"
23
23
"code.gitea.io/gitea/modules/notification"
24
+ "code.gitea.io/gitea/modules/repofiles"
24
25
"code.gitea.io/gitea/modules/setting"
25
26
"code.gitea.io/gitea/modules/util"
26
27
"code.gitea.io/gitea/services/gitdiff"
@@ -928,6 +929,21 @@ func CleanUpPullRequest(ctx *context.Context) {
928
929
return
929
930
}
930
931
932
+ if err := repofiles .PushUpdate (
933
+ pr .HeadRepo ,
934
+ pr .HeadBranch ,
935
+ models.PushUpdateOptions {
936
+ RefFullName : git .BranchPrefix + pr .HeadBranch ,
937
+ OldCommitID : branchCommitID ,
938
+ NewCommitID : git .EmptySHA ,
939
+ PusherID : ctx .User .ID ,
940
+ PusherName : ctx .User .Name ,
941
+ RepoUserName : pr .HeadRepo .Owner .Name ,
942
+ RepoName : pr .HeadRepo .Name ,
943
+ }); err != nil {
944
+ log .Error ("Update: %v" , err )
945
+ }
946
+
931
947
if err := models .AddDeletePRBranchComment (ctx .User , pr .BaseRepo , issue .ID , pr .HeadBranch ); err != nil {
932
948
// Do not fail here as branch has already been deleted
933
949
log .Error ("DeleteBranch: %v" , err )
0 commit comments