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
iv
gitlab-ce
Commits
8461c4b4
Commit
8461c4b4
authored
Feb 23, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8180 from Bugagazavr/mr_update
Trigger merge request hook when source updated
parents
9f9a79ab
de7c3291
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 @
8461c4b4
...
@@ -53,7 +53,7 @@ module MergeRequests
...
@@ -53,7 +53,7 @@ module MergeRequests
if
merge_request
.
source_branch
==
@branch_name
||
force_push?
if
merge_request
.
source_branch
==
@branch_name
||
force_push?
merge_request
.
reload_code
merge_request
.
reload_code
merge_request
.
mark_as_unchecked
update_merge_request
(
merge_request
)
else
else
mr_commit_ids
=
merge_request
.
commits
.
map
(
&
:id
)
mr_commit_ids
=
merge_request
.
commits
.
map
(
&
:id
)
push_commit_ids
=
@commits
.
map
(
&
:id
)
push_commit_ids
=
@commits
.
map
(
&
:id
)
...
@@ -61,14 +61,20 @@ module MergeRequests
...
@@ -61,14 +61,20 @@ module MergeRequests
if
matches
.
any?
if
matches
.
any?
merge_request
.
reload_code
merge_request
.
reload_code
merge_request
.
mark_as_unchecked
update_merge_request
(
merge_request
)
else
else
merge_request
.
mark_as_unchecked
update_merge_request
(
merge_request
)
end
end
end
end
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
# Add comment about pushing new commits to merge requests
def
comment_mr_with_commits
def
comment_mr_with_commits
merge_requests
=
@project
.
origin_merge_requests
.
opened
.
where
(
source_branch:
@branch_name
).
to_a
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