diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-09-22 14:43:11 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-09-22 14:43:11 +0300 |
commit | 604f176bf8b23c5658348f875d40495f5640ce7d (patch) | |
tree | 724fbb514ac535e12ff2b91d536b98ccf6c9d8db /lib/gitlab/git/repository.rb | |
parent | d426b6bcc674d1dd8c8e0d45bb2e032f6fa94ea4 (diff) | |
parent | eb36fa17a6ae5cda8950904b5a52e6aa365ae591 (diff) |
Merge branch 'feature/migrate-repository-diff' into 'master'
Migrate Gitlab::Git::Repository#diff to Gitaly
Closes gitaly#524
See merge request gitlab-org/gitlab-ce!14251
Diffstat (limited to 'lib/gitlab/git/repository.rb')
-rw-r--r-- | lib/gitlab/git/repository.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 0be35034d24..10ba29acbd1 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -475,7 +475,15 @@ module Gitlab # diff options. The +options+ hash can also include :break_rewrites to # split larger rewrites into delete/add pairs. def diff(from, to, options = {}, *paths) - Gitlab::Git::DiffCollection.new(diff_patches(from, to, options, *paths), options) + iterator = gitaly_migrate(:diff_between) do |is_enabled| + if is_enabled + gitaly_commit_client.diff(from, to, options.merge(paths: paths)) + else + diff_patches(from, to, options, *paths) + end + end + + Gitlab::Git::DiffCollection.new(iterator, options) end # Returns a RefName for a given SHA |