Fixed that Subversion#load_entries_changesets raises an error if entries is nil.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9823 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-06-12 17:43:23 +00:00
parent 965ef33192
commit 667693b32c
2 changed files with 7 additions and 0 deletions

View File

@ -89,6 +89,8 @@ class Repository::Subversion < Repository
protected
def load_entries_changesets(entries)
return unless entries
entries_with_identifier = entries.select {|entry| entry.lastrev && entry.lastrev.identifier.present?}
identifiers = entries_with_identifier.map {|entry| entry.lastrev.identifier}.compact.uniq

View File

@ -61,6 +61,11 @@ class RepositorySubversionTest < ActiveSupport::TestCase
assert_kind_of Redmine::Scm::Adapters::Entries, entries
end
def test_entries_for_invalid_path_should_return_nil
entries = @repository.entries('invalid_path')
assert_nil entries
end
def test_latest_changesets
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets