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
66112e3f6b9a
Commit
71033c9e
authored
May 22, 2013
by
Dmitriy Zaporozhets
Browse files
handle broken diffs gracefully
parent
12f31c0e2f48
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/models/merge_request.rb
View file @
66112e3f
...
...
@@ -118,7 +118,7 @@ def reloaded_diffs
end
def
broken_diffs?
diffs
==
[
Gitlab
::
Git
::
Diff
::
BROKEN_DIFF
]
diffs
==
broken_diffs
end
def
valid_diffs?
...
...
@@ -214,10 +214,22 @@ def load_commits(array)
end
def
dump_diffs
(
diffs
)
diffs
.
map
(
&
:to_hash
)
if
broken_diffs?
broken_diffs
else
diffs
.
map
(
&
:to_hash
)
end
end
def
load_diffs
(
raw
)
if
raw
==
broken_diffs
broken_diffs
else
raw
.
map
{
|
hash
|
Gitlab
::
Git
::
Diff
.
new
(
hash
)
}
end
end
def
load_diffs
(
array
)
array
.
map
{
|
hash
|
Gitlab
::
Git
::
Diff
.
new
(
hash
)
}
def
broken_diffs
[
Gitlab
::
Git
::
Diff
::
BROKEN_DIFF
]
end
end
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