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:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-12-20 19:22:13 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-01-03 21:13:32 +0300
commitc328a7db75b601bed449ad04100e12779f5bdb36 (patch)
tree7f7ae439053aecff85d5ea0e00d54190f18f03c7
parent582678b5f5e1399603610b20149acf1d305309d3 (diff)
Handle exceptions when writing to .git/config
-rw-r--r--app/models/project.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 1182dbda0c0..47ca62aa5bb 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1440,6 +1440,9 @@ class Project < ActiveRecord::Base
def write_repository_config(key, value, prefix: :gitlab)
key = [prefix, key].compact.join('.')
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
def rename_repo_notify!