Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Upstream
Gitea
Commits
f0bda12c
Commit
f0bda12c
authored
5 years ago
by
Brad Albright
Committed by
Lunny Xiao
5 years ago
Browse files
Options
Download
Email Patches
Plain Diff
when branch is deleted after a pull request is merged, trigger webhook (#9510)
parent
58c38ab4
release/v1.10
v1.10.6
v1.10.4
v1.10.3
v1.10.2
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
routers/repo/pull.go
+16
-0
routers/repo/pull.go
with
16 additions
and
0 deletions
+16
-0
routers/repo/pull.go
View file @
f0bda12c
...
...
@@ -21,6 +21,7 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/repofiles"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/gitdiff"
...
...
@@ -928,6 +929,21 @@ func CleanUpPullRequest(ctx *context.Context) {
return
}
if
err
:=
repofiles
.
PushUpdate
(
pr
.
HeadRepo
,
pr
.
HeadBranch
,
models
.
PushUpdateOptions
{
RefFullName
:
git
.
BranchPrefix
+
pr
.
HeadBranch
,
OldCommitID
:
branchCommitID
,
NewCommitID
:
git
.
EmptySHA
,
PusherID
:
ctx
.
User
.
ID
,
PusherName
:
ctx
.
User
.
Name
,
RepoUserName
:
pr
.
HeadRepo
.
Owner
.
Name
,
RepoName
:
pr
.
HeadRepo
.
Name
,
});
err
!=
nil
{
log
.
Error
(
"Update: %v"
,
err
)
}
if
err
:=
models
.
AddDeletePRBranchComment
(
ctx
.
User
,
pr
.
BaseRepo
,
issue
.
ID
,
pr
.
HeadBranch
);
err
!=
nil
{
// Do not fail here as branch has already been deleted
log
.
Error
(
"DeleteBranch: %v"
,
err
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help