BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e4038cb5
Commit
e4038cb5
authored
Jun 09, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cache-diff-size-limits' into 'master'
Only look up diff size limit flags once per request See merge request !12048
parents
07e05c6f
9b42be02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
diff.rb
lib/gitlab/git/diff.rb
+18
-2
No files found.
lib/gitlab/git/diff.rb
View file @
e4038cb5
...
...
@@ -23,6 +23,23 @@ module Gitlab
class
<<
self
# The maximum size of a diff to display.
def
size_limit
if
RequestStore
.
active?
RequestStore
[
'gitlab_git_diff_size_limit'
]
||=
find_size_limit
else
find_size_limit
end
end
# The maximum size before a diff is collapsed.
def
collapse_limit
if
RequestStore
.
active?
RequestStore
[
'gitlab_git_diff_collapse_limit'
]
||=
find_collapse_limit
else
find_collapse_limit
end
end
def
find_size_limit
if
Feature
.
enabled?
(
'gitlab_git_diff_size_limit_increase'
)
200
.
kilobytes
else
...
...
@@ -30,8 +47,7 @@ module Gitlab
end
end
# The maximum size before a diff is collapsed.
def
collapse_limit
def
find_collapse_limit
if
Feature
.
enabled?
(
'gitlab_git_diff_size_limit_increase'
)
100
.
kilobytes
else
...
...
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