diff options
author | Phil Hughes <me@iamphill.com> | 2018-02-19 15:54:01 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-02-19 15:54:01 +0000 |
commit | 0f5b56f96151b47957e7c497d44f983a23863086 (patch) | |
tree | 4db39f420153447ef7a2554d6fc406ce09aedb17 /app/workers/process_commit_worker.rb | |
parent | 704ec01955e98c9098e5e57c2d0cb0c2493af5ad (diff) | |
parent | fb2a76ac484f5bba305abdf7b54a18ee8133f63f (diff) | |
download | gitlab-ce-0f5b56f96151b47957e7c497d44f983a23863086.tar.gz |
Merge branch 'master' into ph-dispatcher-cleanupph-dispatcher-cleanup
Diffstat (limited to 'app/workers/process_commit_worker.rb')
-rw-r--r-- | app/workers/process_commit_worker.rb | 12 |
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) |