| ... | @@ -5,7 +5,8 @@ class CommitLoad < BaseContext |
... | @@ -5,7 +5,8 @@ class CommitLoad < BaseContext |
|
|
suppress_diff: false,
|
|
suppress_diff: false,
|
|
|
line_notes: [],
|
|
line_notes: [],
|
|
|
notes_count: 0,
|
|
notes_count: 0,
|
|
|
note: nil
|
|
note: nil,
|
|
|
|
status: :ok
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
commit = project.commit(params[:id])
|
|
commit = project.commit(params[:id])
|
| ... | @@ -14,11 +15,17 @@ class CommitLoad < BaseContext |
... | @@ -14,11 +15,17 @@ class CommitLoad < BaseContext |
|
|
commit = CommitDecorator.decorate(commit)
|
|
commit = CommitDecorator.decorate(commit)
|
|
|
line_notes = project.commit_line_notes(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[:commit] = commit
|
|
|
result[:note] = project.build_commit_note(commit)
|
|
result[:note] = project.build_commit_note(commit)
|
|
|
result[:line_notes] = line_notes
|
|
result[:line_notes] = line_notes
|
|
|
result[:notes_count] = line_notes.count + project.commit_notes(commit).count
|
|
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
|
|
end
|
|
|
|
|
|
|
|
result
|
|
result
|
| ... | |
... | |
| ... | | ... | |