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
9b42be02
Commit
9b42be02
authored
Jun 09, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only look up diff size limit flags once per request
parent
8ce11fc3
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 @
9b42be02
...
...
@@ -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