summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/import/bitbucket_controller.rb13
-rw-r--r--app/views/import/bitbucket/status.html.haml6
2 files changed, 9 insertions, 10 deletions
diff --git a/app/controllers/import/bitbucket_controller.rb b/app/controllers/import/bitbucket_controller.rb
index e7150cb8e95..72c90f9daf2 100644
--- a/app/controllers/import/bitbucket_controller.rb
+++ b/app/controllers/import/bitbucket_controller.rb
@@ -17,11 +17,10 @@ class Import::BitbucketController < Import::BaseController
end
def status
- client = Bitbucket::Client.new(credentials)
- repos = client.repos
+ bitbucket_client = Bitbucket::Client.new(credentials)
+ repos = bitbucket_client.repos
- @repos = repos.select(&:valid?)
- @incompatible_repos = repos.reject(&:valid?)
+ @repos, @incompatible_repos = repos.partition { |repo| repo.valid? }
@already_added_projects = current_user.created_projects.where(import_type: 'bitbucket')
already_added_projects_names = @already_added_projects.pluck(:import_source)
@@ -36,15 +35,15 @@ class Import::BitbucketController < Import::BaseController
end
def create
- client = Bitbucket::Client.new(credentials)
+ bitbucket_client = Bitbucket::Client.new(credentials)
@repo_id = params[:repo_id].to_s
name = @repo_id.gsub('___', '/')
- repo = client.repo(name)
+ repo = bitbucket_client.repo(name)
@project_name = params[:new_name].presence || repo.name
repo_owner = repo.owner
- repo_owner = current_user.username if repo_owner == client.user.username
+ repo_owner = current_user.username if repo_owner == bitbucket_client.user.username
@target_namespace = params[:new_namespace].presence || repo_owner
namespace = find_or_create_namespace(@target_namespace, repo_owner)
diff --git a/app/views/import/bitbucket/status.html.haml b/app/views/import/bitbucket/status.html.haml
index cc262e97ceb..ac09b71ae89 100644
--- a/app/views/import/bitbucket/status.html.haml
+++ b/app/views/import/bitbucket/status.html.haml
@@ -33,7 +33,7 @@
- @already_added_projects.each do |project|
%tr{id: "project_#{project.id}", class: "#{project_status_css_class(project.import_status)}"}
%td
- = link_to project.import_source, 'https://bitbucket.org/#{project.import_source}', target: '_blank'
+ = link_to project.import_source, "https://bitbucket.org/#{project.import_source}", target: '_blank'
%td
= link_to project.path_with_namespace, [project.namespace.becomes(Namespace), project]
%td.job-status
@@ -50,7 +50,7 @@
- @repos.each do |repo|
%tr{id: "repo_#{repo.owner}___#{repo.slug}"}
%td
- = link_to "#{repo.full_name}", "https://bitbucket.org/#{repo.full_name}", target: "_blank"
+ = link_to repo.full_name, "https://bitbucket.org/#{repo.full_name}", target: "_blank"
%td.import-target
%fieldset.row
.input-group
@@ -70,7 +70,7 @@
- @incompatible_repos.each do |repo|
%tr{id: "repo_#{repo.owner}___#{repo.slug}"}
%td
- = link_to "#{repo.full_name}", "https://bitbucket.org/#{repo.full_name}", target: '_blank'
+ = link_to repo.full_name, "https://bitbucket.org/#{repo.full_name}", target: '_blank'
%td.import-target
%td.import-actions-job-status
= label_tag 'Incompatible Project', nil, class: 'label label-danger'