Move rugged-call from Project#write_repository_config to Git::Repository#write_config

This commit is contained in:
Kim "BKC" Carlbäcker 2018-01-19 07:29:33 +01:00
parent 4353801826
commit e1925f6d68
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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