Commit 6a1da567 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'gitaly-write-repo-config-prep' into 'master'

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

See merge request gitlab-org/gitlab-ce!16572
parents bd5bb6ee 31268b1b
......@@ -1438,7 +1438,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
......
......@@ -1317,6 +1317,10 @@ module Gitlab
end
# rubocop:enable Metrics/ParameterLists
def write_config(full_path:)
rugged.config['gitlab.fullpath'] = full_path if full_path.present?
end
def gitaly_repository
Gitlab::GitalyClient::Util.repository(@storage, @relative_path, @gl_repository)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment