From e363fbf71a7874de2352740b3f33350e5ec4cf54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Tue, 25 Jul 2017 17:26:52 -0400 Subject: Move `deltas` and `diff_from_parents` logic to Gitlab::Git::Commit This helps keep the abstraction layers simpler, and also keep the interface of those methods consistent, in case of implementation changes. --- app/models/commit.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'app/models/commit.rb') diff --git a/app/models/commit.rb b/app/models/commit.rb index 96605c9168b..638fddc5d3d 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -321,21 +321,11 @@ class Commit end def raw_diffs(*args) - if Gitlab::GitalyClient.feature_enabled?(:commit_raw_diffs) - Gitlab::GitalyClient::CommitService.new(project.repository).diff_from_parent(self, *args) - else - raw.diffs(*args) - end + raw.diffs(*args) end def raw_deltas - @deltas ||= Gitlab::GitalyClient.migrate(:commit_deltas) do |is_enabled| - if is_enabled - Gitlab::GitalyClient::CommitService.new(project.repository).commit_deltas(self) - else - raw.deltas - end - end + @deltas ||= raw.deltas end def diffs(diff_options = nil) -- cgit v1.2.1