Handle exceptions when writing to .git/config

parent 582678b5
...@@ -1440,6 +1440,9 @@ class Project < ActiveRecord::Base ...@@ -1440,6 +1440,9 @@ class Project < ActiveRecord::Base
def write_repository_config(key, value, prefix: :gitlab) def write_repository_config(key, value, prefix: :gitlab)
key = [prefix, key].compact.join('.') key = [prefix, key].compact.join('.')
repo.config[key] = value repo.config[key] = value
rescue Gitlab::Git::Repository::NoRepository => e
Rails.logger.error("Error writing key #{key} to .git/config for project #{full_path} (#{id}): #{e.message}.")
nil
end end
def rename_repo_notify! def rename_repo_notify!
......
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