Remove branches that does exist on GitHub after PRs were imported

parent ebaa19c1
...@@ -79,8 +79,6 @@ module Gitlab ...@@ -79,8 +79,6 @@ module Gitlab
create_refs(branches_removed) create_refs(branches_removed)
project.repository.fetch_ref(repo_url, '+refs/heads/*', 'refs/heads/*')
pull_requests.each do |pull_request| pull_requests.each do |pull_request|
merge_request = MergeRequest.new(pull_request.attributes) merge_request = MergeRequest.new(pull_request.attributes)
...@@ -102,11 +100,14 @@ module Gitlab ...@@ -102,11 +100,14 @@ module Gitlab
branches.each do |name, sha| branches.each do |name, sha|
client.create_ref(repo, "refs/heads/#{name}", sha) client.create_ref(repo, "refs/heads/#{name}", sha)
end end
project.repository.fetch_ref(repo_url, '+refs/heads/*', 'refs/heads/*')
end end
def delete_refs(branches) def delete_refs(branches)
branches.each do |name, _| branches.each do |name, _|
client.delete_ref(repo, "heads/#{name}") client.delete_ref(repo, "heads/#{name}")
project.repository.rm_branch(project.creator, name)
end end
end end
......
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