applying feedback

#	modified:   lib/gitlab/git/commit.rb
This commit is contained in:
Micaël Bergeron 2018-02-16 13:49:07 -05:00
parent f949255461
commit af5cd10e00
3 changed files with 6 additions and 5 deletions

View file

@ -25,14 +25,14 @@ class ProcessCommitWorker
commit = build_commit(project, commit_hash)
author = commit.author || user
# this is a GitLab generated commit message, ignore it.
return if commit.merged_merge_request?(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)
# this is a GitLab generated commit message, ignore it.
return if commit.merged_merge_request?(user)
closed_issues = default ? commit.closes_issues(user) : []
close_issues(project, user, author, commit, closed_issues) if closed_issues.any?

View file

@ -473,7 +473,8 @@ module Gitlab
def parent_ids=(shas)
@parent_ids = case shas
when String then JSON.parse(shas)
when String
JSON.parse(shas)
else
shas
end

View file

@ -39,7 +39,7 @@ describe ProcessCommitWorker do
project.repository.commit(sha)
end
it 'does not process the commit' do
it 'it does not close any issues from the commit message' do
expect(worker).not_to receive(:close_issues)
worker.perform(project.id, user.id, commit.to_hash)