Commit 4b87d804 authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

Fix merge requests not showing any diff files for big patches

parent a58d0a01
...@@ -423,7 +423,7 @@ group :ed25519 do ...@@ -423,7 +423,7 @@ group :ed25519 do
end end
# Gitaly GRPC client # Gitaly GRPC client
gem 'gitaly-proto', '~> 0.112.0', require: 'gitaly' gem 'gitaly-proto', '~> 0.113.0', require: 'gitaly'
gem 'grpc', '~> 1.11.0' gem 'grpc', '~> 1.11.0'
# Locked until https://github.com/google/protobuf/issues/4210 is closed # Locked until https://github.com/google/protobuf/issues/4210 is closed
......
...@@ -284,7 +284,7 @@ GEM ...@@ -284,7 +284,7 @@ GEM
gettext_i18n_rails (>= 0.7.1) gettext_i18n_rails (>= 0.7.1)
po_to_json (>= 1.0.0) po_to_json (>= 1.0.0)
rails (>= 3.2.0) rails (>= 3.2.0)
gitaly-proto (0.112.0) gitaly-proto (0.113.0)
google-protobuf (~> 3.1) google-protobuf (~> 3.1)
grpc (~> 1.10) grpc (~> 1.10)
github-linguist (5.3.3) github-linguist (5.3.3)
...@@ -1045,7 +1045,7 @@ DEPENDENCIES ...@@ -1045,7 +1045,7 @@ DEPENDENCIES
gettext (~> 3.2.2) gettext (~> 3.2.2)
gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.3) gettext_i18n_rails_js (~> 1.3)
gitaly-proto (~> 0.112.0) gitaly-proto (~> 0.113.0)
github-linguist (~> 5.3.3) github-linguist (~> 5.3.3)
gitlab-flowdock-git-hook (~> 1.0.1) gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-gollum-lib (~> 4.2) gitlab-gollum-lib (~> 4.2)
......
...@@ -287,7 +287,7 @@ GEM ...@@ -287,7 +287,7 @@ GEM
gettext_i18n_rails (>= 0.7.1) gettext_i18n_rails (>= 0.7.1)
po_to_json (>= 1.0.0) po_to_json (>= 1.0.0)
rails (>= 3.2.0) rails (>= 3.2.0)
gitaly-proto (0.112.0) gitaly-proto (0.113.0)
google-protobuf (~> 3.1) google-protobuf (~> 3.1)
grpc (~> 1.10) grpc (~> 1.10)
github-linguist (5.3.3) github-linguist (5.3.3)
...@@ -1057,7 +1057,7 @@ DEPENDENCIES ...@@ -1057,7 +1057,7 @@ DEPENDENCIES
gettext (~> 3.2.2) gettext (~> 3.2.2)
gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.3) gettext_i18n_rails_js (~> 1.3)
gitaly-proto (~> 0.112.0) gitaly-proto (~> 0.113.0)
github-linguist (~> 5.3.3) github-linguist (~> 5.3.3)
gitlab-flowdock-git-hook (~> 1.0.1) gitlab-flowdock-git-hook (~> 1.0.1)
gitlab-gollum-lib (~> 4.2) gitlab-gollum-lib (~> 4.2)
...@@ -1216,4 +1216,4 @@ DEPENDENCIES ...@@ -1216,4 +1216,4 @@ DEPENDENCIES
wikicloth (= 0.8.1) wikicloth (= 0.8.1)
BUNDLED WITH BUNDLED WITH
1.16.2 1.16.3
---
title: Fix merge requests not showing any diff files for big patches
merge_request: 21125
author:
type: fixed
...@@ -226,6 +226,7 @@ module Gitlab ...@@ -226,6 +226,7 @@ module Gitlab
@new_file = diff.from_id == BLANK_SHA @new_file = diff.from_id == BLANK_SHA
@renamed_file = diff.from_path != diff.to_path @renamed_file = diff.from_path != diff.to_path
@deleted_file = diff.to_id == BLANK_SHA @deleted_file = diff.to_id == BLANK_SHA
@too_large = diff.too_large if diff.respond_to?(:too_large)
collapse! if diff.respond_to?(:collapsed) && diff.collapsed collapse! if diff.respond_to?(:collapsed) && diff.collapsed
end end
......
module Gitlab module Gitlab
module GitalyClient module GitalyClient
class Diff class Diff
ATTRS = %i(from_path to_path old_mode new_mode from_id to_id patch overflow_marker collapsed).freeze ATTRS = %i(from_path to_path old_mode new_mode from_id to_id patch overflow_marker collapsed too_large).freeze
include AttributesBag include AttributesBag
end end
......
...@@ -9,7 +9,9 @@ describe Gitlab::GitalyClient::Diff do ...@@ -9,7 +9,9 @@ describe Gitlab::GitalyClient::Diff do
new_mode: 0100644, new_mode: 0100644,
from_id: '357406f3075a57708d0163752905cc1576fceacc', from_id: '357406f3075a57708d0163752905cc1576fceacc',
to_id: '8e5177d718c561d36efde08bad36b43687ee6bf0', to_id: '8e5177d718c561d36efde08bad36b43687ee6bf0',
patch: 'a' * 100 patch: 'a' * 100,
collapsed: false,
too_large: false
} }
end end
...@@ -22,6 +24,8 @@ describe Gitlab::GitalyClient::Diff do ...@@ -22,6 +24,8 @@ describe Gitlab::GitalyClient::Diff do
it { is_expected.to respond_to(:from_id) } it { is_expected.to respond_to(:from_id) }
it { is_expected.to respond_to(:to_id) } it { is_expected.to respond_to(:to_id) }
it { is_expected.to respond_to(:patch) } it { is_expected.to respond_to(:patch) }
it { is_expected.to respond_to(:collapsed) }
it { is_expected.to respond_to(:too_large) }
describe '#==' do describe '#==' do
it { expect(subject).to eq(described_class.new(diff_fields)) } it { expect(subject).to eq(described_class.new(diff_fields)) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment