diff options
author | Robert Speicher <robert@gitlab.com> | 2017-03-17 20:41:44 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-03-17 20:41:44 +0300 |
commit | 5409a3c5b7cb1aa66de7a8702b862556d7d49298 (patch) | |
tree | 589f6e9c8a0029c700bd367b77b05fbb24d5625a /app/models/commit.rb | |
parent | c1b4f800f3a0fb5cc5c5f7a121a499ba6ed128c1 (diff) | |
parent | c0a4f527db7d3e10f843468522d574cdb5427e86 (diff) |
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.rb | 9 |
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) |