Prevent unexpected nil error in GitAdapter#info if the repository path is invalid.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1239 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-03-12 23:09:11 +00:00
parent 2c1e63720e
commit ea161c9ea4
1 changed files with 6 additions and 5 deletions

View File

@ -94,11 +94,12 @@ module Redmine
def info def info
root_url = target('') revs = revisions(url,nil,nil,{:limit => 1})
info = Info.new({:root_url => target(''), if revs && revs.any?
:lastrev => revisions(root_url,nil,nil,{:limit => 1}).first Info.new(:root_url => url, :lastrev => revs.first)
}) else
info nil
end
rescue Errno::ENOENT => e rescue Errno::ENOENT => e
return nil return nil
end end