Commit 0bcabdaf8330d0a260d95ee8435170fa7258eb98

Authored by Dmitriy Zaporozhets
1 parent bb44a7a2

Use gitlab_git 5.4.0 without BROKEN_DIFF constant

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
@@ -29,7 +29,7 @@ gem &#39;omniauth-github&#39; @@ -29,7 +29,7 @@ gem &#39;omniauth-github&#39;
29 29
30 # Extracting information from a git repository 30 # Extracting information from a git repository
31 # Provide access to Gitlab::Git library 31 # Provide access to Gitlab::Git library
32 -gem "gitlab_git", '~> 5.3.0' 32 +gem "gitlab_git", '~> 5.4.0'
33 33
34 # Ruby/Rack Git Smart-HTTP Server Handler 34 # Ruby/Rack Git Smart-HTTP Server Handler
35 gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack' 35 gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
@@ -177,7 +177,7 @@ GEM @@ -177,7 +177,7 @@ GEM
177 charlock_holmes (~> 0.6.6) 177 charlock_holmes (~> 0.6.6)
178 escape_utils (~> 0.2.4) 178 escape_utils (~> 0.2.4)
179 mime-types (~> 1.19) 179 mime-types (~> 1.19)
180 - gitlab_git (5.3.0) 180 + gitlab_git (5.4.0)
181 activesupport (~> 4.0.0) 181 activesupport (~> 4.0.0)
182 charlock_holmes (~> 0.6.9) 182 charlock_holmes (~> 0.6.9)
183 gitlab-grit (~> 2.6.1) 183 gitlab-grit (~> 2.6.1)
@@ -579,7 +579,7 @@ DEPENDENCIES @@ -579,7 +579,7 @@ DEPENDENCIES
579 gitlab-gollum-lib (~> 1.1.0) 579 gitlab-gollum-lib (~> 1.1.0)
580 gitlab-grack (~> 2.0.0.pre) 580 gitlab-grack (~> 2.0.0.pre)
581 gitlab-linguist (~> 3.0.0) 581 gitlab-linguist (~> 3.0.0)
582 - gitlab_git (~> 5.3.0) 582 + gitlab_git (~> 5.4.0)
583 gitlab_meta (= 6.0) 583 gitlab_meta (= 6.0)
584 gitlab_omniauth-ldap (= 1.0.4) 584 gitlab_omniauth-ldap (= 1.0.4)
585 gon (~> 5.0.0) 585 gon (~> 5.0.0)
app/controllers/projects/compare_controller.rb
@@ -15,11 +15,7 @@ class Projects::CompareController &lt; Projects::ApplicationController @@ -15,11 +15,7 @@ class Projects::CompareController &lt; Projects::ApplicationController
15 @diffs = compare.diffs 15 @diffs = compare.diffs
16 @refs_are_same = compare.same 16 @refs_are_same = compare.same
17 @line_notes = [] 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 diff_line_count = Commit::diff_line_count(@diffs) 20 diff_line_count = Commit::diff_line_count(@diffs)
25 @suppress_diff = Commit::diff_suppress?(@diffs, diff_line_count) && !params[:force_show_diff] 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 &lt; ActiveRecord::Base @@ -148,13 +148,11 @@ class MergeRequestDiff &lt; ActiveRecord::Base
148 Gitlab::Git::Diff.between(repository, source_branch, target_branch) 148 Gitlab::Git::Diff.between(repository, source_branch, target_branch)
149 end 149 end
150 150
151 - if diffs == broken_diffs  
152 - self.state = :timeout  
153 - diffs = []  
154 - end  
155 -  
156 diffs ||= [] 151 diffs ||= []
157 diffs 152 diffs
  153 + rescue Gitlab::Git::Diff::TimeoutError => ex
  154 + self.state = :timeout
  155 + diffs = []
158 end 156 end
159 157
160 def repository 158 def repository