Commit 256aedff authored by Robert Speicher's avatar Robert Speicher

Merge branch 'fix-mirror' into 'master'

Fix updating of branches in mirrored repository

Reported in https://gitlab.com/gitlab-org/gitlab-ee/issues/190#note_3373621

See merge request !136
parents 06afaa91 6cd70ea3
......@@ -3,6 +3,8 @@ v 8.5.0 (unreleased)
v 8.4.2
- Elasticsearch indexer performance improvements
- Don't redirect away from Mirror Repository settings when repo is empty.
v 8.4.2 (unreleased)
- Fix updating of branches in mirrored repository
v 8.4.1
- No EE-specific changes
......
......@@ -142,7 +142,7 @@ module ApplicationHelper
return false unless project.repository.branch_names.include?(event.branch_name)
# Skip if this was a mirror update
return false if project.mirror? && project.up_to_date_with_upstream?(event.branch_name)
return false if project.mirror? && project.repository.up_to_date_with_upstream?(event.branch_name)
true
end
......
......@@ -59,7 +59,7 @@ class GitPushService
@push_data = build_push_data(oldrev, newrev, ref)
branch_name = Gitlab::Git.ref_name(ref)
mirror_update = project.mirror? && project.up_to_date_with_upstream?(branch_name)
mirror_update = project.mirror? && project.repository.up_to_date_with_upstream?(branch_name)
EventCreateService.new.push(project, user, @push_data)
project.execute_hooks(@push_data.dup, :push_hooks)
......
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