Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
548de16b6904
Commit
6347e9a6
authored
Mar 20, 2013
by
Dmitriy Zaporozhets
Browse files
Dont load diff in compare over 100 commits
parent
2bec5a7fa289
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/commit.rb
View file @
548de16b
...
...
@@ -89,7 +89,14 @@ def compare(project, from, to)
if
first
&&
last
result
[
:same
]
=
(
first
.
id
==
last
.
id
)
result
[
:commits
]
=
project
.
repo
.
commits_between
(
last
.
id
,
first
.
id
).
map
{
|
c
|
Commit
.
new
(
c
)}
result
[
:diffs
]
=
project
.
repo
.
diff
(
last
.
id
,
first
.
id
)
rescue
[]
# Dont load diff for 100+ commits
result
[
:diffs
]
=
if
result
[
:commits
].
size
>
100
[]
else
project
.
repo
.
diff
(
last
.
id
,
first
.
id
)
rescue
[]
end
result
[
:commit
]
=
Commit
.
new
(
first
)
end
...
...
app/views/compare/show.html.haml
View file @
548de16b
...
...
@@ -6,6 +6,12 @@
=
render
"form"
-
if
@commits
.
size
>
100
.alert.alert-block
%p
%strong
Warning! This comparison include 100+ commits.
%p
To prevent performance issue we dont show diff information.
-
if
@commits
.
present?
%div
.ui-box
%h5
.title
...
...
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