diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-05-10 17:23:03 -0500 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-05-13 17:55:43 -0500 |
commit | 290aa75e6f8dfbd92ed11f6c271fb4ad83831e86 (patch) | |
tree | c077662b568495abd935e86aa48b4997547244a8 /lib | |
parent | ebaa19c162bec7dce64db25124e448d832c17384 (diff) | |
download | gitlab-ce-290aa75e6f8dfbd92ed11f6c271fb4ad83831e86.tar.gz |
Remove branches that does exist on GitHub after PRs were imported
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/github_import/importer.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb index 1f160837c5d..408d9b79632 100644 --- a/lib/gitlab/github_import/importer.rb +++ b/lib/gitlab/github_import/importer.rb @@ -79,8 +79,6 @@ module Gitlab create_refs(branches_removed) - project.repository.fetch_ref(repo_url, '+refs/heads/*', 'refs/heads/*') - pull_requests.each do |pull_request| merge_request = MergeRequest.new(pull_request.attributes) @@ -102,11 +100,14 @@ module Gitlab branches.each do |name, sha| client.create_ref(repo, "refs/heads/#{name}", sha) end + + project.repository.fetch_ref(repo_url, '+refs/heads/*', 'refs/heads/*') end def delete_refs(branches) branches.each do |name, _| client.delete_ref(repo, "heads/#{name}") + project.repository.rm_branch(project.creator, name) end end |