diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-07-25 17:26:52 -0400 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-08-07 23:33:40 -0400 |
commit | e363fbf71a7874de2352740b3f33350e5ec4cf54 (patch) | |
tree | 4868c4cb0b05272a3fb6a4e35b2f8d73d8778f02 /app/models/commit.rb | |
parent | c21ae07e331ca14605410555d0582f14cb661bb6 (diff) | |
download | gitlab-ce-e363fbf71a7874de2352740b3f33350e5ec4cf54.tar.gz |
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.
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 14 |
1 files changed, 2 insertions, 12 deletions
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) |