diff options
author | gfyoung <gfyoung17@gmail.com> | 2018-10-11 13:12:21 -0700 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2018-10-13 02:31:31 -0700 |
commit | e166e5747c6e8130f1227b427113f1231d9f46f1 (patch) | |
tree | 9cf61f1a7388bfce3f22fd927ee9582d37b8910b /lib/gitlab/bare_repository_import | |
parent | 79ba38920144191320df1e6529b8feab4acef758 (diff) | |
download | gitlab-ce-e166e5747c6e8130f1227b427113f1231d9f46f1.tar.gz |
Enable some frozen string in lib/gitlab
Enable frozen string for the following files:
* lib/gitlab/auth/**/*.rb
* lib/gitlab/badge/**/*.rb
* lib/gitlab/bare_repository_import/**/*.rb
* lib/gitlab/bitbucket_import/**/*.rb
* lib/gitlab/bitbucket_server_import/**/*.rb
* lib/gitlab/cache/**/*.rb
* lib/gitlab/checks/**/*.rb
Partially addresses #47424.
Diffstat (limited to 'lib/gitlab/bare_repository_import')
-rw-r--r-- | lib/gitlab/bare_repository_import/importer.rb | 7 | ||||
-rw-r--r-- | lib/gitlab/bare_repository_import/repository.rb | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/gitlab/bare_repository_import/importer.rb b/lib/gitlab/bare_repository_import/importer.rb index 04aa6aab771..3cd327f5109 100644 --- a/lib/gitlab/bare_repository_import/importer.rb +++ b/lib/gitlab/bare_repository_import/importer.rb @@ -1,10 +1,15 @@ +# frozen_string_literal: true + module Gitlab module BareRepositoryImport class Importer NoAdminError = Class.new(StandardError) def self.execute(import_path) - import_path << '/' unless import_path.ends_with?('/') + unless import_path.ends_with?('/') + import_path = "#{import_path}/" + end + repos_to_import = Dir.glob(import_path + '**/*.git') unless user = User.admins.order_id_asc.first diff --git a/lib/gitlab/bare_repository_import/repository.rb b/lib/gitlab/bare_repository_import/repository.rb index c0c666dfb7b..b903c581aac 100644 --- a/lib/gitlab/bare_repository_import/repository.rb +++ b/lib/gitlab/bare_repository_import/repository.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module BareRepositoryImport class Repository @@ -6,9 +8,12 @@ module Gitlab attr_reader :group_path, :project_name, :repo_path def initialize(root_path, repo_path) + unless root_path.ends_with?('/') + root_path = "#{root_path}/" + end + @root_path = root_path @repo_path = repo_path - @root_path << '/' unless root_path.ends_with?('/') full_path = if hashed? && !wiki? |