diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-12-20 19:22:13 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-01-03 21:13:32 +0300 |
commit | c328a7db75b601bed449ad04100e12779f5bdb36 (patch) | |
tree | 7f7ae439053aecff85d5ea0e00d54190f18f03c7 | |
parent | 582678b5f5e1399603610b20149acf1d305309d3 (diff) |
Handle exceptions when writing to .git/config
-rw-r--r-- | app/models/project.rb | 3 |
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! |