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
e4059f41
Commit
e4059f41
authored
Mar 03, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
73be2f86
1c706c68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
app/services/merge_requests/merge_service.rb
app/services/merge_requests/merge_service.rb
+1
-2
changelogs/unreleased/sh-show-pre-receive-error-merge.yml
changelogs/unreleased/sh-show-pre-receive-error-merge.yml
+5
-0
spec/services/merge_requests/merge_service_spec.rb
spec/services/merge_requests/merge_service_spec.rb
+1
-1
No files found.
app/services/merge_requests/merge_service.rb
View file @
e4059f41
...
@@ -76,8 +76,7 @@ module MergeRequests
...
@@ -76,8 +76,7 @@ module MergeRequests
def
try_merge
def
try_merge
repository
.
merge
(
current_user
,
source
,
merge_request
,
commit_message
)
repository
.
merge
(
current_user
,
source
,
merge_request
,
commit_message
)
rescue
Gitlab
::
Git
::
PreReceiveError
=>
e
rescue
Gitlab
::
Git
::
PreReceiveError
=>
e
handle_merge_error
(
log_message:
e
.
message
)
raise_error
(
"Something went wrong during merge pre-receive hook:
#{
e
.
message
}
"
)
raise_error
(
'Something went wrong during merge pre-receive hook'
)
rescue
=>
e
rescue
=>
e
handle_merge_error
(
log_message:
e
.
message
)
handle_merge_error
(
log_message:
e
.
message
)
raise_error
(
'Something went wrong during merge'
)
raise_error
(
'Something went wrong during merge'
)
...
...
changelogs/unreleased/sh-show-pre-receive-error-merge.yml
0 → 100644
View file @
e4059f41
---
title
:
Show pre-receive error message when merge fails
merge_request
:
25708
author
:
type
:
fixed
spec/services/merge_requests/merge_service_spec.rb
View file @
e4059f41
...
@@ -244,7 +244,7 @@ describe MergeRequests::MergeService do
...
@@ -244,7 +244,7 @@ describe MergeRequests::MergeService do
service
.
execute
(
merge_request
)
service
.
execute
(
merge_request
)
expect
(
merge_request
.
merge_error
).
to
include
(
'Something went wrong during merge pre-receive hook'
)
expect
(
merge_request
.
merge_error
).
to
include
(
"Something went wrong during merge pre-receive hook:
#{
error_message
}
"
)
expect
(
Rails
.
logger
).
to
have_received
(
:error
).
with
(
a_string_matching
(
error_message
))
expect
(
Rails
.
logger
).
to
have_received
(
:error
).
with
(
a_string_matching
(
error_message
))
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