summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-03-17 17:41:44 +0000
committerRobert Speicher <robert@gitlab.com>2017-03-17 17:41:44 +0000
commit5409a3c5b7cb1aa66de7a8702b862556d7d49298 (patch)
tree589f6e9c8a0029c700bd367b77b05fbb24d5625a /app/models/commit.rb
parentc1b4f800f3a0fb5cc5c5f7a121a499ba6ed128c1 (diff)
parentc0a4f527db7d3e10f843468522d574cdb5427e86 (diff)
downloadgitlab-ce-5409a3c5b7cb1aa66de7a8702b862556d7d49298.tar.gz
Merge branch 'feature/use-gitaly-for-commit-show' into 'master'
Use Gitaly for CommitController#show See merge request !9629
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 6ea5b1ae51f..ce92cc369ad 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -321,7 +321,14 @@ class Commit
end
def raw_diffs(*args)
- raw.diffs(*args)
+ use_gitaly = Gitlab::GitalyClient.feature_enabled?(:commit_raw_diffs)
+ deltas_only = args.last.is_a?(Hash) && args.last[:deltas_only]
+
+ if use_gitaly && !deltas_only
+ Gitlab::GitalyClient::Commit.diff_from_parent(self, *args)
+ else
+ raw.diffs(*args)
+ end
end
def diffs(diff_options = nil)