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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
6347e9a6
Commit
6347e9a6
authored
Mar 20, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont load diff in compare over 100 commits
parent
72db22d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/commit.rb
app/models/commit.rb
+8
-1
app/views/compare/show.html.haml
app/views/compare/show.html.haml
+6
-0
No files found.
app/models/commit.rb
View file @
6347e9a6
...
...
@@ -89,7 +89,14 @@ class Commit
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 @
6347e9a6
...
...
@@ -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