summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorLong Nguyen <long.polyglot@gmail.com>2016-05-20 17:00:48 +0700
committerLong Nguyen <long.polyglot@gmail.com>2016-05-20 17:00:48 +0700
commited9b6497865e28c60e96dbc30567987165b0b221 (patch)
tree1d29d3780df108ab8c7900ff1077422058a15285 /app/workers
parentb9ab18f6edc3c8f668f16996f6cfa36d126a8082 (diff)
parentf26389a02a48a53cccb3bb7dd1d7bcd4858c118d (diff)
downloadgitlab-ce-ed9b6497865e28c60e96dbc30567987165b0b221.tar.gz
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into issue_17479_todos_not_remove_when_leave_project
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/emails_on_push_worker.rb18
-rw-r--r--app/workers/repository_import_worker.rb2
2 files changed, 12 insertions, 8 deletions
diff --git a/app/workers/emails_on_push_worker.rb b/app/workers/emails_on_push_worker.rb
index 6ebcba5f39b..fa959fc56e3 100644
--- a/app/workers/emails_on_push_worker.rb
+++ b/app/workers/emails_on_push_worker.rb
@@ -27,15 +27,18 @@ class EmailsOnPushWorker
:push
end
+ diff_refs = nil
compare = nil
reverse_compare = false
if action == :push
compare = Gitlab::Git::Compare.new(project.repository.raw_repository, before_sha, after_sha)
+ diff_refs = [project.merge_base_commit(before_sha, after_sha), project.commit(after_sha)]
return false if compare.same
if compare.commits.empty?
compare = Gitlab::Git::Compare.new(project.repository.raw_repository, after_sha, before_sha)
+ diff_refs = [project.merge_base_commit(after_sha, before_sha), project.commit(before_sha)]
reverse_compare = true
@@ -48,13 +51,14 @@ class EmailsOnPushWorker
send_email(
recipient,
project_id,
- author_id: author_id,
- ref: ref,
- action: action,
- compare: compare,
- reverse_compare: reverse_compare,
- send_from_committer_email: send_from_committer_email,
- disable_diffs: disable_diffs
+ author_id: author_id,
+ ref: ref,
+ action: action,
+ compare: compare,
+ reverse_compare: reverse_compare,
+ diff_refs: diff_refs,
+ send_from_committer_email: send_from_committer_email,
+ disable_diffs: disable_diffs
)
# These are input errors and won't be corrected even if Sidekiq retries
diff --git a/app/workers/repository_import_worker.rb b/app/workers/repository_import_worker.rb
index 2937493c614..fbc7ed63c6a 100644
--- a/app/workers/repository_import_worker.rb
+++ b/app/workers/repository_import_worker.rb
@@ -13,7 +13,7 @@ class RepositoryImportWorker
result = Projects::ImportService.new(project, current_user).execute
if result[:status] == :error
- project.update(import_error: result[:message])
+ project.update(import_error: Gitlab::UrlSanitizer.sanitize(result[:message]))
project.import_fail
return
end