diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-09-11 14:52:27 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-09-21 11:05:06 +0200 |
commit | eb36fa17a6ae5cda8950904b5a52e6aa365ae591 (patch) | |
tree | 867ca7add72ad14dd6bb342eb60b963d8faa9ee7 /lib/gitlab/git/repository.rb | |
parent | 36dc65d5ca34234faf8e79106ed081a28659d899 (diff) | |
download | gitlab-ce-eb36fa17a6ae5cda8950904b5a52e6aa365ae591.tar.gz |
Migrate Gitlab::Git::Repository#diff to Gitalyfeature/migrate-repository-diff
Closes gitaly#524
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 4b000bd31e2..6d9f742a2d3 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 |