diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-04-21 16:02:21 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-05-08 00:37:42 +0300 |
commit | 34cd10979757cdad26056a532cf09c59a7f74ae9 (patch) | |
tree | 28644688c71cdd089870444eba9a5455f1535143 /app/models/commit.rb | |
parent | 6ad3814e1b31bfacfae7a2aabb4e4607b12ca66f (diff) |
Re-enable Gitaly commit_raw_diff feature
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 88a015cdb77..9359b323ed4 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -326,13 +326,14 @@ class Commit end def raw_diffs(*args) - # NOTE: This feature is intentionally disabled until - # https://gitlab.com/gitlab-org/gitaly/issues/178 is resolved - # if Gitlab::GitalyClient.feature_enabled?(:commit_raw_diffs) - # Gitlab::GitalyClient::Commit.diff_from_parent(self, *args) - # else - raw.diffs(*args) - # end + 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) |