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
iv
gitlab-ce
Commits
731b6be9
Commit
731b6be9
authored
Aug 11, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle app crash on huge commits
parent
ac525a74
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
app/contexts/commit_load.rb
app/contexts/commit_load.rb
+9
-2
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+3
-2
No files found.
app/contexts/commit_load.rb
View file @
731b6be9
...
...
@@ -5,7 +5,8 @@ class CommitLoad < BaseContext
suppress_diff:
false
,
line_notes:
[],
notes_count:
0
,
note:
nil
note:
nil
,
status: :ok
}
commit
=
project
.
commit
(
params
[
:id
])
...
...
@@ -14,11 +15,17 @@ class CommitLoad < BaseContext
commit
=
CommitDecorator
.
decorate
(
commit
)
line_notes
=
project
.
commit_line_notes
(
commit
)
result
[
:suppress_diff
]
=
true
if
commit
.
diffs
.
size
>
200
&&
!
params
[
:force_show_diff
]
result
[
:commit
]
=
commit
result
[
:note
]
=
project
.
build_commit_note
(
commit
)
result
[
:line_notes
]
=
line_notes
result
[
:notes_count
]
=
line_notes
.
count
+
project
.
commit_notes
(
commit
).
count
begin
result
[
:suppress_diff
]
=
true
if
commit
.
diffs
.
size
>
200
&&
!
params
[
:force_show_diff
]
rescue
Grit
::
Git
::
GitTimeout
result
[
:suppress_diff
]
=
true
result
[
:status
]
=
:huge_commit
end
end
result
...
...
app/controllers/commits_controller.rb
View file @
731b6be9
...
...
@@ -41,8 +41,9 @@ class CommitsController < ApplicationController
return
git_not_found!
end
rescue
Grit
::
Git
::
GitTimeout
render
"huge_commit"
if
result
[
:status
]
==
:huge_commit
render
"huge_commit"
and
return
end
end
def
compare
...
...
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