diff options
author | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2018-01-22 15:40:38 +0100 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2018-01-22 15:40:38 +0100 |
commit | 728d7e0cf7b1570bc53f143a69612365e493d7a8 (patch) | |
tree | ad2e050df01fca8f843063b6c9491987b8dc1ac3 /app/models | |
parent | 58aa32bceab1483897f3e898151e60b0cf917f68 (diff) | |
download | gitlab-ce-728d7e0cf7b1570bc53f143a69612365e493d7a8.tar.gz |
Move error-handling to lib/gitlab/git
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/repository.rb | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index f717d248615..73c4899cb9b 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -259,17 +259,7 @@ class Repository return if kept_around?(sha) # This will still fail if the file is corrupted (e.g. 0 bytes) - begin - raw_repository.write_ref(keep_around_ref_name(sha), sha, shell: false) - rescue Gitlab::Git::CommandError => ex - if ex.message.start_with?("ReferenceError: ") - Rails.logger.error "Unable to create #{REF_KEEP_AROUND} reference for repository #{path}: #{ex}" - elsif ex.message.start_with?("OSError: ") - raise unless ex.message =~ /Failed to create locked file/ && ex.message =~ /File exists/ - - Rails.logger.error "Unable to create #{REF_KEEP_AROUND} reference for repository #{path}: #{ex}" - end - end + raw_repository.write_ref(keep_around_ref_name(sha), sha, shell: false) end def kept_around?(sha) |