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:
authorKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2018-01-19 09:29:33 +0300
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2018-01-19 13:45:06 +0300
commite1925f6d680722cb630e18b63312d9643357c4a2 (patch)
treef889704e848aba13d3b81448ae24c1c5409ba727
parent43538018261a5d1cccefecae895fad9e74adb1db (diff)
Move rugged-call from Project#write_repository_config to Git::Repository#write_config
-rw-r--r--app/models/project.rb2
-rw-r--r--lib/gitlab/git/repository.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 4017864f718..86f1c0c18b7 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1437,7 +1437,7 @@ class Project < ActiveRecord::Base
# We'd need to keep track of project full path otherwise directory tree
# created with hashed storage enabled cannot be usefully imported using
# the import rake task.
- repository.rugged.config['gitlab.fullpath'] = gl_full_path
+ repository.raw_repository.write_config(full_path: gl_full_path)
rescue Gitlab::Git::Repository::NoRepository => e
Rails.logger.error("Error writing to .git/config for project #{full_path} (#{id}): #{e.message}.")
nil
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index b89a38d187e..69368898cc1 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -1317,6 +1317,10 @@ module Gitlab
end
# rubocop:enable Metrics/ParameterLists
+ def write_config(full_path: nil)
+ rugged.config['gitlab.fullpath'] = full_path
+ end
+
def gitaly_repository
Gitlab::GitalyClient::Util.repository(@storage, @relative_path, @gl_repository)
end