提交 0d9f74d2 编写于 作者: S Stan Hu

Delete temporary branches after an import

上级 c793252e
......@@ -29,6 +29,7 @@ module Gitlab
def execute
import_repository
import_pull_requests
delete_temp_branches
handle_errors
true
......@@ -142,6 +143,17 @@ module Gitlab
end
end
def delete_temp_branches
@temp_branches.each do |branch_name|
begin
client.delete_branch(project_key, repository_slug, branch_name)
project.repository.delete_branch(branch_name)
rescue BitbucketServer::Connection::ConnectionError => e
@errors << { type: :delete_temp_branches, branch_name: branch_name, errors: e.message }
end
end
end
def import_bitbucket_pull_request(pull_request)
description = ''
description += @formatter.author_line(pull_request.author) unless find_user_id(pull_request.author_email)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册