Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
6eeff4cd
Commit
6eeff4cd
authored
Oct 11, 2017
by
micael.bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the merger override to remove source branch
parent
845b2f1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
app/services/merge_requests/merge_service.rb
app/services/merge_requests/merge_service.rb
+8
-5
No files found.
app/services/merge_requests/merge_service.rb
View file @
6eeff4cd
...
...
@@ -60,15 +60,13 @@ module MergeRequests
def
after_merge
MergeRequests
::
PostMergeService
.
new
(
project
,
current_user
).
execute
(
merge_request
)
if
params
[
:should_remove_source_branch
].
present?
||
@merge_request
.
force_remov
e_source_branch?
if
delet
e_source_branch?
# Verify again that the source branch can be removed, since branch may be protected,
# or the source branch may have been updated.
if
@merge_request
.
can_remove_source_branch?
(
branch_deletion_user
)
DeleteBranchService
.
new
(
@merge_request
.
source_project
,
branch_deletion_user
)
.
execute
(
merge_request
.
source_branch
)
end
end
end
def
clean_merge_jid
merge_request
.
update_column
(
:merge_jid
,
nil
)
...
...
@@ -78,6 +76,11 @@ module MergeRequests
@merge_request
.
force_remove_source_branch?
?
@merge_request
.
author
:
current_user
end
def
delete_source_branch?
params
.
fetch
(
'should_remove_source_branch'
,
@merge_request
.
force_remove_source_branch?
)
&&
@merge_request
.
can_remove_source_branch?
(
branch_deletion_user
)
end
# Logs merge error message and cleans `MergeRequest#merge_jid`.
#
def
handle_merge_error
(
log_message
:,
save_message_on_model:
false
)
...
...
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