diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-10 22:56:54 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-10 22:56:54 +0000 |
commit | d90cdb1b1073c38c498caf79d6cac39e19c16992 (patch) | |
tree | 6e1e036d47ea5802237defa14f43ae793e1b3f38 /lib/redmine/scm | |
parent | c5c8cd43c03f28add2ee3dce549f704cd19a224e (diff) | |
download | redmine-d90cdb1b1073c38c498caf79d6cac39e19c16992.tar.gz redmine-d90cdb1b1073c38c498caf79d6cac39e19c16992.zip |
scm: git: raise exception if "git log" is error and block is given in lib revision method (#8857)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8837 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/scm')
-rw-r--r-- | lib/redmine/scm/adapters/git_adapter.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index d6c554461..9639b41f9 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -290,8 +290,13 @@ module Redmine end revs rescue ScmCommandAborted => e - logger.error("git log #{from_to.to_s} error: #{e.message}") - revs + err_msg = "git log error: #{e.message}" + logger.error(err_msg) + if block_given? + raise CommandFailed, err_msg + else + revs + end end def diff(path, identifier_from, identifier_to=nil) |