summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-25 17:08:32 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-04-25 17:08:32 -0300
commit70d15ae1d968070e82028dd48c15c363ac9f8fa9 (patch)
treef8565cc37c84e58072bb19ad0a673fd777144273
parent44954c507ed99db892e9e4e40779bc6fc6f0a56f (diff)
downloadgitlab-ce-70d15ae1d968070e82028dd48c15c363ac9f8fa9.tar.gz
Fix Rubocop offenses
-rw-r--r--lib/github/import.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/github/import.rb b/lib/github/import.rb
index 96b69d78c55..f12f979ae02 100644
--- a/lib/github/import.rb
+++ b/lib/github/import.rb
@@ -160,8 +160,7 @@ module Github
next unless merge_request.new_record? && pull_request.valid?
begin
- restore_source_branch(pull_request) unless pull_request.source_branch_exists?
- restore_target_branch(pull_request) unless pull_request.target_branch_exists?
+ restore_branches(pull_request)
author_id = user_id(pull_request.author, project.creator_id)
merge_request.iid = pull_request.iid
@@ -310,6 +309,11 @@ module Github
end
end
+ def restore_branches(pull_request)
+ restore_source_branch(pull_request) unless pull_request.source_branch_exists?
+ restore_target_branch(pull_request) unless pull_request.target_branch_exists?
+ end
+
def restore_source_branch(pull_request)
repository.create_branch(pull_request.source_branch_name, pull_request.source_branch_sha)
end