summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-02-20 14:59:18 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-02-20 14:59:18 +0000
commit5aa4d7bfb4a3ffa7881bdba0a0dcc50cdb245684 (patch)
tree977602ffd37d6b248be78241635119485ec9c73d /app/workers
parent3619c9174558bd2b2ae625ac6db480c437eb8484 (diff)
parentb876a52bf7c2287d438ff8df371720c5bb75ed51 (diff)
downloadgitlab-ce-5aa4d7bfb4a3ffa7881bdba0a0dcc50cdb245684.tar.gz
Merge branch 'master' into 42643-persist-external-ip-of-ingress-controller-gke
* master: (30 commits) Docs: Pages - clean up articles Only use features for events Put all event metrics exposed to prometheus behind a feature flag Add version which LFS lock was introduced Remove unecessary validate: true from belongs_to :project fix broken specs remove common_d3 bundle remove graphs_show webpack bundle Chart.html.haml refactor Remove extraneous tests from Issues API spec [GH Import] Create an empty wiki if wiki import failed Resolve "group request membership mail with too long list of "To:"" Add changelog entry Fix single digit value clipping specify date format Increase feature flag cache TTL to one hour Convert Gitaly commit parent IDs to array as early as possible Clarify changelog for squash encoding fix Avoid slow File Lock checks when not used Fix squash rebase not working when diff contained encoded data ...
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/process_commit_worker.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/workers/process_commit_worker.rb b/app/workers/process_commit_worker.rb
index 52eebe475ec..5b25d980bdb 100644
--- a/app/workers/process_commit_worker.rb
+++ b/app/workers/process_commit_worker.rb
@@ -23,27 +23,25 @@ class ProcessCommitWorker
return unless user
commit = build_commit(project, commit_hash)
-
author = commit.author || user
process_commit_message(project, commit, user, author, default)
-
update_issue_metrics(commit, author)
end
def process_commit_message(project, commit, user, author, default = false)
- closed_issues = default ? commit.closes_issues(user) : []
+ # this is a GitLab generated commit message, ignore it.
+ return if commit.merged_merge_request?(user)
- unless closed_issues.empty?
- close_issues(project, user, author, commit, closed_issues)
- end
+ closed_issues = default ? commit.closes_issues(user) : []
+ close_issues(project, user, author, commit, closed_issues) if closed_issues.any?
commit.create_cross_references!(author, closed_issues)
end
def close_issues(project, user, author, commit, issues)
# We don't want to run permission related queries for every single issue,
- # therefor we use IssueCollection here and skip the authorization check in
+ # therefore we use IssueCollection here and skip the authorization check in
# Issues::CloseService#execute.
IssueCollection.new(issues).updatable_by_user(user).each do |issue|
Issues::CloseService.new(project, author)