diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-27 19:00:34 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-08-03 07:00:20 +0200 |
commit | c86c1905b5574cac234315598d8d715fcaee3ea7 (patch) | |
tree | 31ba7ab51c04b07ea70d15db88f2370f9ca6359e /app/workers | |
parent | 1d0c7b74920a94e488e6a2c090abb3e525438053 (diff) | |
download | gitlab-ce-c86c1905b5574cac234315598d8d715fcaee3ea7.tar.gz |
switch from diff_file_collection to diffs20034-safe-diffs
So we have raw_diffs too
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/emails_on_push_worker.rb | 9 | ||||
-rw-r--r-- | app/workers/irker_worker.rb | 6 |
2 files changed, 6 insertions, 9 deletions
diff --git a/app/workers/emails_on_push_worker.rb b/app/workers/emails_on_push_worker.rb index 0b63913cfd1..c6a5af2809a 100644 --- a/app/workers/emails_on_push_worker.rb +++ b/app/workers/emails_on_push_worker.rb @@ -33,18 +33,13 @@ class EmailsOnPushWorker reverse_compare = false if action == :push - base_commit = project.merge_base_commit(before_sha, after_sha) - compare = Gitlab::Git::Compare.new(project.repository.raw_repository, before_sha, after_sha) - compare = Compare.decorate(compare, project) - compare.base_commit = base_commit + compare = CompareService.new.execute(project, before_sha, project, after_sha) diff_refs = compare.diff_refs return false if compare.same if compare.commits.empty? - compare = Gitlab::Git::Compare.new(project.repository.raw_repository, after_sha, before_sha) - compare = Compare.decorate(compare, project) - compare.base_commit = base_commit + compare = CompareService.new.execute(project, after_sha, project, before_sha) diff_refs = compare.diff_refs reverse_compare = true diff --git a/app/workers/irker_worker.rb b/app/workers/irker_worker.rb index a3c34e02baa..07cc7c1cbd7 100644 --- a/app/workers/irker_worker.rb +++ b/app/workers/irker_worker.rb @@ -141,8 +141,10 @@ class IrkerWorker end def files_count(commit) - files = "#{commit.diffs.real_size} file" - files += 's' if commit.diffs.size > 1 + diffs = commit.raw_diffs + + files = "#{diffs.real_size} file" + files += 's' if diffs.size > 1 files end |