]> source.dussan.org Git - redmine.git/commitdiff
Fixed that Subversion#load_entries_changesets raises an error if entries is nil.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Jun 2012 17:43:23 +0000 (17:43 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Jun 2012 17:43:23 +0000 (17:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9823 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/subversion.rb
test/unit/repository_subversion_test.rb

index 7c12f3f3e599951233ceb081fdcd25f71d454140..c50e99ec8589294a06cdad04bb5abcf7993dfa0f 100644 (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
 
index 699ef886a9f32a9a3d6479e21e0dacca7ce69d30..e2550453a6f7a31ed0cfb363a1e78af801836500 100644 (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