Commit 0bcabdaf8330d0a260d95ee8435170fa7258eb98
1 parent
bb44a7a2
Exists in
spb-stable
and in
3 other branches
Use gitlab_git 5.4.0 without BROKEN_DIFF constant
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
4 changed files
with
7 additions
and
13 deletions
Show diff stats
Gemfile
| ... | ... | @@ -29,7 +29,7 @@ gem 'omniauth-github' |
| 29 | 29 | |
| 30 | 30 | # Extracting information from a git repository |
| 31 | 31 | # Provide access to Gitlab::Git library |
| 32 | -gem "gitlab_git", '~> 5.3.0' | |
| 32 | +gem "gitlab_git", '~> 5.4.0' | |
| 33 | 33 | |
| 34 | 34 | # Ruby/Rack Git Smart-HTTP Server Handler |
| 35 | 35 | gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack' | ... | ... |
Gemfile.lock
| ... | ... | @@ -177,7 +177,7 @@ GEM |
| 177 | 177 | charlock_holmes (~> 0.6.6) |
| 178 | 178 | escape_utils (~> 0.2.4) |
| 179 | 179 | mime-types (~> 1.19) |
| 180 | - gitlab_git (5.3.0) | |
| 180 | + gitlab_git (5.4.0) | |
| 181 | 181 | activesupport (~> 4.0.0) |
| 182 | 182 | charlock_holmes (~> 0.6.9) |
| 183 | 183 | gitlab-grit (~> 2.6.1) |
| ... | ... | @@ -579,7 +579,7 @@ DEPENDENCIES |
| 579 | 579 | gitlab-gollum-lib (~> 1.1.0) |
| 580 | 580 | gitlab-grack (~> 2.0.0.pre) |
| 581 | 581 | gitlab-linguist (~> 3.0.0) |
| 582 | - gitlab_git (~> 5.3.0) | |
| 582 | + gitlab_git (~> 5.4.0) | |
| 583 | 583 | gitlab_meta (= 6.0) |
| 584 | 584 | gitlab_omniauth-ldap (= 1.0.4) |
| 585 | 585 | gon (~> 5.0.0) | ... | ... |
app/controllers/projects/compare_controller.rb
| ... | ... | @@ -15,11 +15,7 @@ class Projects::CompareController < Projects::ApplicationController |
| 15 | 15 | @diffs = compare.diffs |
| 16 | 16 | @refs_are_same = compare.same |
| 17 | 17 | @line_notes = [] |
| 18 | - | |
| 19 | - if @diffs == [Gitlab::Git::Diff::BROKEN_DIFF] | |
| 20 | - @diffs = [] | |
| 21 | - @timeout = true | |
| 22 | - end | |
| 18 | + @timeout = compare.timeout | |
| 23 | 19 | |
| 24 | 20 | diff_line_count = Commit::diff_line_count(@diffs) |
| 25 | 21 | @suppress_diff = Commit::diff_suppress?(@diffs, diff_line_count) && !params[:force_show_diff] | ... | ... |
app/models/merge_request_diff.rb
| ... | ... | @@ -148,13 +148,11 @@ class MergeRequestDiff < ActiveRecord::Base |
| 148 | 148 | Gitlab::Git::Diff.between(repository, source_branch, target_branch) |
| 149 | 149 | end |
| 150 | 150 | |
| 151 | - if diffs == broken_diffs | |
| 152 | - self.state = :timeout | |
| 153 | - diffs = [] | |
| 154 | - end | |
| 155 | - | |
| 156 | 151 | diffs ||= [] |
| 157 | 152 | diffs |
| 153 | + rescue Gitlab::Git::Diff::TimeoutError => ex | |
| 154 | + self.state = :timeout | |
| 155 | + diffs = [] | |
| 158 | 156 | end |
| 159 | 157 | |
| 160 | 158 | def repository | ... | ... |