summaryrefslogtreecommitdiff
path: root/lib/gitlab/git
diff options
context:
space:
mode:
authorKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2018-01-22 15:40:38 +0100
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2018-01-22 15:40:38 +0100
commit728d7e0cf7b1570bc53f143a69612365e493d7a8 (patch)
treead2e050df01fca8f843063b6c9491987b8dc1ac3 /lib/gitlab/git
parent58aa32bceab1483897f3e898151e60b0cf917f68 (diff)
downloadgitlab-ce-728d7e0cf7b1570bc53f143a69612365e493d7a8.tar.gz
Move error-handling to lib/gitlab/git
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/repository.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index e36ab2e32f6..27037af55c6 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -1395,9 +1395,11 @@ module Gitlab
def rugged_write_ref(ref_path, ref)
rugged.references.create(ref_path, ref, force: true)
rescue Rugged::ReferenceError => ex
- raise CommandError, "ReferenceError: #{ex}"
+ Rails.logger.error "Unable to create #{ref_path} reference for repository #{path}: #{ex}"
rescue Rugged::OSError => ex
- raise CommandError, "OSError: #{ex}"
+ raise unless ex.message =~ /Failed to create locked file/ && ex.message =~ /File exists/
+
+ Rails.logger.error "Unable to create #{ref_path} reference for repository #{path}: #{ex}"
end
def fresh_worktree?(path)