diff options
author | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2018-01-19 07:29:33 +0100 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2018-01-19 11:45:06 +0100 |
commit | e1925f6d680722cb630e18b63312d9643357c4a2 (patch) | |
tree | f889704e848aba13d3b81448ae24c1c5409ba727 | |
parent | 43538018261a5d1cccefecae895fad9e74adb1db (diff) | |
download | gitlab-ce-e1925f6d680722cb630e18b63312d9643357c4a2.tar.gz |
Move rugged-call from Project#write_repository_config to Git::Repository#write_config
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/git/repository.rb | 4 |
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 |