Commit a932e28d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix worker error when remove branch

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 87cf5b70
...@@ -22,11 +22,8 @@ class GitPushService ...@@ -22,11 +22,8 @@ class GitPushService
project.update_repository_size project.update_repository_size
if push_to_branch?(ref) if push_to_branch?(ref)
if push_to_existing_branch?(ref, oldrev) if push_remove_branch_branch?(ref, newrev)
# Collect data for this git push @push_commits = []
@push_commits = project.repository.commits_between(oldrev, newrev)
project.update_merge_requests(oldrev, newrev, ref, @user)
process_commit_messages(ref)
elsif push_to_new_branch?(ref, oldrev) elsif push_to_new_branch?(ref, oldrev)
# Re-find the pushed commits. # Re-find the pushed commits.
if is_default_branch?(ref) if is_default_branch?(ref)
...@@ -38,11 +35,12 @@ class GitPushService ...@@ -38,11 +35,12 @@ class GitPushService
# that shouldn't matter because we check for existing cross-references later. # that shouldn't matter because we check for existing cross-references later.
@push_commits = project.repository.commits_between(project.default_branch, newrev) @push_commits = project.repository.commits_between(project.default_branch, newrev)
end end
process_commit_messages(ref) process_commit_messages(ref)
elsif push_to_existing_branch?(ref, oldrev)
elsif push_remove_branch_branch?(ref, newrev) # Collect data for this git push
@push_commits = [] @push_commits = project.repository.commits_between(oldrev, newrev)
project.update_merge_requests(oldrev, newrev, ref, @user)
process_commit_messages(ref)
end end
@push_data = post_receive_data(oldrev, newrev, ref) @push_data = post_receive_data(oldrev, newrev, ref)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment