Remove unecessary commit pattern check

This commit is contained in:
Felipe Artur 2017-05-23 12:33:49 -03:00
parent e44016b90a
commit 0054963544
2 changed files with 1 additions and 11 deletions

View File

@ -25,8 +25,6 @@ class ProcessCommitWorker
commit = build_commit(project, commit_hash)
return unless commit.matches_cross_reference_regex?
author = commit.author || user
process_commit_message(project, commit, user, author, default)
@ -80,7 +78,7 @@ class ProcessCommitWorker
private
# Avoid to re-process commits messages that already exists in the upstream
# Avoid reprocessing commits that already exist in the upstream
# when project is forked. This will also prevent duplicated system notes.
def commit_exists_in_upstream?(project, commit_hash)
return false unless project.forked?

View File

@ -20,14 +20,6 @@ describe ProcessCommitWorker do
worker.perform(project.id, -1, commit.to_hash)
end
it 'does not process the commit when no issues are referenced' do
allow(worker).to receive(:build_commit).and_return(double(matches_cross_reference_regex?: false))
expect(worker).not_to receive(:process_commit_message)
worker.perform(project.id, user.id, commit.to_hash)
end
it 'processes the commit message' do
expect(worker).to receive(:process_commit_message).and_call_original