Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 06:08:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-27 06:08:49 +0300
commit996c6bf06f602ada62e3f754c121c17051072892 (patch)
treec7568793468de0faef693795e00f34c07da8e793 /app/models/repository.rb
parent0a0e82d1440b06650e5fc524168b1f50a8feec68 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index a53850bb068..beb65ff26fd 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -22,7 +22,7 @@ class Repository
include Gitlab::RepositoryCacheAdapter
- attr_accessor :full_path, :disk_path, :container, :repo_type
+ attr_accessor :full_path, :shard, :disk_path, :container, :repo_type
delegate :ref_name_for_sha, to: :raw_repository
delegate :bundle_to_disk, to: :raw_repository
@@ -65,8 +65,9 @@ class Repository
xcode_config: :xcode_project?
}.freeze
- def initialize(full_path, container, disk_path: nil, repo_type: Gitlab::GlRepository::PROJECT)
+ def initialize(full_path, container, shard:, disk_path: nil, repo_type: Gitlab::GlRepository::PROJECT)
@full_path = full_path
+ @shard = shard
@disk_path = disk_path || full_path
@container = container
@commit_cache = {}
@@ -95,7 +96,7 @@ class Repository
def path_to_repo
@path_to_repo ||=
begin
- storage = Gitlab.config.repositories.storages[container.repository_storage]
+ storage = Gitlab.config.repositories.storages[shard]
File.expand_path(
File.join(storage.legacy_disk_path, disk_path + '.git')
@@ -1181,7 +1182,7 @@ class Repository
end
def initialize_raw_repository
- Gitlab::Git::Repository.new(container.repository_storage,
+ Gitlab::Git::Repository.new(shard,
disk_path + '.git',
repo_type.identifier_for_container(container),
container.full_path)