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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
699986bb
Commit
699986bb
authored
May 24, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract a do_execute method to be overridden
This way we don't have to duplicate the guard
parent
a6f7112c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
app/services/merge_requests/refresh_service.rb
app/services/merge_requests/refresh_service.rb
+6
-2
ee/app/services/ee/merge_requests/refresh_service.rb
ee/app/services/ee/merge_requests/refresh_service.rb
+3
-5
No files found.
app/services/merge_requests/refresh_service.rb
View file @
699986bb
...
...
@@ -5,6 +5,12 @@ module MergeRequests
def
execute
(
oldrev
,
newrev
,
ref
)
return
true
unless
Gitlab
::
Git
.
branch_ref?
(
ref
)
do_execute
(
oldrev
,
newrev
,
ref
)
end
private
def
do_execute
(
oldrev
,
newrev
,
ref
)
@oldrev
,
@newrev
=
oldrev
,
newrev
@branch_name
=
Gitlab
::
Git
.
ref_name
(
ref
)
...
...
@@ -30,8 +36,6 @@ module MergeRequests
true
end
private
def
close_upon_missing_source_branch_ref
# MergeRequest#reload_diff ignores not opened MRs. This means it won't
# create an `empty` diff for `closed` MRs without a source branch, keeping
...
...
ee/app/services/ee/merge_requests/refresh_service.rb
View file @
699986bb
...
...
@@ -3,15 +3,13 @@ module EE
module
RefreshService
extend
::
Gitlab
::
Utils
::
Override
override
:execute
def
execute
(
oldrev
,
newrev
,
ref
)
return
true
unless
::
Gitlab
::
Git
.
branch_ref?
(
ref
)
private
override
:do_execute
def
do_execute
(
oldrev
,
newrev
,
ref
)
super
&&
reset_approvals_for_merge_requests
(
ref
,
newrev
)
end
private
# Note: Closed merge requests also need approvals reset.
def
reset_approvals_for_merge_requests
(
ref
,
newrev
)
branch_name
=
::
Gitlab
::
Git
.
ref_name
(
ref
)
...
...
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