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
40172d28
Commit
40172d28
authored
May 30, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix fast-forward merge requests git hooks validations
parent
5a688e4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
app/services/merge_requests/merge_service.rb
app/services/merge_requests/merge_service.rb
+3
-1
spec/services/merge_requests/merge_service_spec.rb
spec/services/merge_requests/merge_service_spec.rb
+8
-0
No files found.
app/services/merge_requests/merge_service.rb
View file @
40172d28
...
...
@@ -9,7 +9,7 @@ module MergeRequests
attr_reader
:merge_request
def
execute
(
merge_request
)
if
@
project
.
merge_requests_ff_only_enabled
&&
!
self
.
is_a?
(
FfMergeService
)
if
project
.
merge_requests_ff_only_enabled
&&
!
self
.
is_a?
(
FfMergeService
)
FfMergeService
.
new
(
project
,
current_user
,
params
).
execute
(
merge_request
)
return
end
...
...
@@ -29,6 +29,8 @@ module MergeRequests
end
def
hooks_validation_pass?
(
merge_request
)
return
true
if
project
.
merge_requests_ff_only_enabled
git_hook
=
merge_request
.
project
.
git_hook
return
true
unless
git_hook
...
...
spec/services/merge_requests/merge_service_spec.rb
View file @
40172d28
...
...
@@ -96,5 +96,13 @@ describe MergeRequests::MergeService, services: true do
expect
(
merge_request
.
merge_error
).
not_to
be_empty
end
end
context
'fast forward merge request'
do
it
'returns true when fast forward is enabled'
do
allow
(
project
).
to
receive
(
:merge_requests_ff_only_enabled
)
{
true
}
expect
(
service
.
hooks_validation_pass?
(
merge_request
)).
to
be_truthy
end
end
end
end
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