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
37d0cbaa
Commit
37d0cbaa
authored
May 16, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
f086a28e
c841c877
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
app/models/repository.rb
app/models/repository.rb
+2
-2
changelogs/unreleased/sh-fix-rebase-error-clearing.yml
changelogs/unreleased/sh-fix-rebase-error-clearing.yml
+5
-0
spec/services/merge_requests/rebase_service_spec.rb
spec/services/merge_requests/rebase_service_spec.rb
+26
-0
No files found.
app/models/repository.rb
View file @
37d0cbaa
...
...
@@ -1050,7 +1050,7 @@ class Repository
# To support the full deprecated behaviour, set the
# `rebase_commit_sha` for the merge_request here and return the value
merge_request
.
update
(
rebase_commit_sha:
rebase_sha
)
merge_request
.
update
(
rebase_commit_sha:
rebase_sha
,
merge_error:
nil
)
rebase_sha
end
...
...
@@ -1069,7 +1069,7 @@ class Repository
remote_repository:
merge_request
.
target_project
.
repository
.
raw
,
remote_branch:
merge_request
.
target_branch
)
do
|
commit_id
|
merge_request
.
update!
(
rebase_commit_sha:
commit_id
)
merge_request
.
update!
(
rebase_commit_sha:
commit_id
,
merge_error:
nil
)
end
end
end
...
...
changelogs/unreleased/sh-fix-rebase-error-clearing.yml
0 → 100644
View file @
37d0cbaa
---
title
:
Properly clear the merge error upon rebase failure
merge_request
:
28319
author
:
type
:
fixed
spec/services/merge_requests/rebase_service_spec.rb
View file @
37d0cbaa
...
...
@@ -38,6 +38,32 @@ describe MergeRequests::RebaseService do
end
end
shared_examples
'sequence of failure and success'
do
it
'properly clears the error message'
do
allow
(
repository
).
to
receive
(
:gitaly_operation_client
).
and_raise
(
'Something went wrong'
)
service
.
execute
(
merge_request
)
expect
(
merge_request
.
reload
.
merge_error
).
to
eq
described_class
::
REBASE_ERROR
allow
(
repository
).
to
receive
(
:gitaly_operation_client
).
and_call_original
service
.
execute
(
merge_request
)
expect
(
merge_request
.
reload
.
merge_error
).
to
eq
nil
end
end
it_behaves_like
'sequence of failure and success'
context
'with deprecated step rebase feature'
do
before
do
allow
(
Feature
).
to
receive
(
:disabled?
).
with
(
:two_step_rebase
,
anything
).
and_return
(
true
)
end
it_behaves_like
'sequence of failure and success'
end
context
'when unexpected error occurs'
do
before
do
allow
(
repository
).
to
receive
(
:gitaly_operation_client
).
and_raise
(
'Something went wrong'
)
...
...
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