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
e1e868cb
Commit
e1e868cb
authored
Oct 13, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update #old_version? method
Fixes this to account for the latest ID not being set yet when this is called
parent
f0527376
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+1
-6
No files found.
app/models/merge_request_diff.rb
View file @
e1e868cb
...
...
@@ -505,11 +505,6 @@ class MergeRequestDiff < ApplicationRecord
merge_request
.
closed?
&&
merge_request
.
metrics
.
latest_closed_at
<
EXTERNAL_DIFF_CUTOFF
.
ago
end
# We can't rely on `merge_request.latest_merge_request_diff_id` because that
# may have been changed in `save_git_content` without being reflected in
# the association's instance. This query is always subject to races, but
# the worst case is that we *don't* make a diff external when we could. The
# background worker will make it external at a later date.
def
old_version?
latest_id
=
MergeRequest
.
where
(
id:
merge_request_id
)
...
...
@@ -517,7 +512,7 @@ class MergeRequestDiff < ApplicationRecord
.
pluck
(
:latest_merge_request_diff_id
)
.
first
self
.
id
!=
latest_id
latest_id
&&
self
.
id
<
latest_id
end
def
load_diffs
(
options
)
...
...
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