diff options
author | Florian Hibler <fhibler@users.noreply.github.com> | 2015-02-26 16:47:18 +0000 |
---|---|---|
committer | Florian Hibler <fhibler@users.noreply.github.com> | 2015-02-26 16:47:18 +0000 |
commit | 1c85b3202033ed965abe16e15688f0b0025561ea (patch) | |
tree | 4ea9288b7a3dc774a60cdbd096761df4da147f8e /lib/oxidized/output/git.rb | |
parent | 19de2ac51cd765e1c7b7fe731759fb50086675b5 (diff) | |
parent | db165b5e1ebb3091a49029d739b68a913bc75db6 (diff) |
Merge pull request #1 from ytti/master
Merge to latest
Diffstat (limited to 'lib/oxidized/output/git.rb')
-rw-r--r-- | lib/oxidized/output/git.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/oxidized/output/git.rb b/lib/oxidized/output/git.rb index 0c73638..d5eb8e7 100644 --- a/lib/oxidized/output/git.rb +++ b/lib/oxidized/output/git.rb @@ -1,5 +1,6 @@ module Oxidized class Git < Output + class GitError < OxidizedError; end begin gem 'rugged', '~> 0.21.0' require 'rugged' @@ -71,8 +72,12 @@ class Git < Output end repo = Rugged::Repository.new repo update_repo repo, file, data, @msg, @user, @email - rescue Rugged::OSError, Rugged::RepositoryError - Rugged::Repository.init_at repo, :bare + rescue Rugged::OSError, Rugged::RepositoryError => open_error + begin + Rugged::Repository.init_at repo, :bare + rescue => create_error + raise GitError, "first '#{open_error.message}' was raised while opening git repo, then '#{create_error.message}' was while trying to create git repo" + end retry end |