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
f5e24b32
Commit
f5e24b32
authored
Nov 27, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display base diff for merged merge requests
It should stay so until merge ref diff is persisted in the database
parent
babfbe0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+8
-0
No files found.
app/models/merge_request.rb
View file @
f5e24b32
...
...
@@ -972,7 +972,7 @@ class MergeRequest < ApplicationRecord
# rubocop: enable CodeReuse/ServiceClass
def
diffable_merge_ref?
merge_ref_head
.
present?
&&
(
Feature
.
enabled?
(:
display_merge_conflicts_in_diff
,
project
)
||
can_be_merged?
)
open
?
&&
merge_ref_head
.
present?
&&
(
Feature
.
enabled?
(:
display_merge_conflicts_in_diff
,
project
)
||
can_be_merged?
)
end
# Returns boolean indicating the merge_status should be rechecked in order to
...
...
spec/models/merge_request_spec.rb
View file @
f5e24b32
...
...
@@ -4275,6 +4275,14 @@ RSpec.describe MergeRequest, factory_default: :keep do
expect
(
subject
.
diffable_merge_ref?
).
to
eq
(
true
)
end
context
'merge request is merged'
do
subject
{
build_stubbed
(
:merge_request
,
:merged
,
project:
project
)
}
it
'returns false'
do
expect
(
subject
.
diffable_merge_ref?
).
to
eq
(
false
)
end
end
context
'merge request cannot be merged'
do
before
do
subject
.
mark_as_unchecked!
...
...
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