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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
de7c3291
Commit
de7c3291
authored
Nov 20, 2014
by
Kirill Zaitsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trigger merge request hook when source updated
parent
c7db2661
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
app/services/merge_requests/refresh_service.rb
app/services/merge_requests/refresh_service.rb
+9
-3
No files found.
app/services/merge_requests/refresh_service.rb
View file @
de7c3291
...
...
@@ -51,7 +51,7 @@ module MergeRequests
if
merge_request
.
source_branch
==
@branch_name
||
force_push?
merge_request
.
reload_code
merge_request
.
mark_as_unchecked
update_merge_request
(
merge_request
)
else
mr_commit_ids
=
merge_request
.
commits
.
map
(
&
:id
)
push_commit_ids
=
@commits
.
map
(
&
:id
)
...
...
@@ -59,14 +59,20 @@ module MergeRequests
if
matches
.
any?
merge_request
.
reload_code
merge_request
.
mark_as_unchecked
update_merge_request
(
merge_request
)
else
merge_request
.
mark_as_unchecked
update_merge_request
(
merge_request
)
end
end
end
end
def
update_merge_request
(
merge_request
)
MergeRequests
::
UpdateService
.
new
(
merge_request
.
target_project
,
@current_user
,
merge_status:
'unchecked'
).
execute
(
merge_request
)
end
# Add comment about pushing new commits to merge requests
def
comment_mr_with_commits
merge_requests
=
@project
.
origin_merge_requests
.
opened
.
where
(
source_branch:
@branch_name
).
to_a
...
...
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