summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-07-25 17:26:52 -0400
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-08-07 23:33:40 -0400
commite363fbf71a7874de2352740b3f33350e5ec4cf54 (patch)
tree4868c4cb0b05272a3fb6a4e35b2f8d73d8778f02 /app/models/commit.rb
parentc21ae07e331ca14605410555d0582f14cb661bb6 (diff)
downloadgitlab-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.rb14
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)