From 37c6480e4453c769ffcacc96b6f7d1378fc9d582 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 12 Apr 2011 05:45:37 +0000 Subject: [PATCH] scm: darcs: model entries returns nil if revision is not stored in database. Prevent showing invalid revision in repository tab. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5433 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository/darcs.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/repository/darcs.rb b/app/models/repository/darcs.rb index 5a9e7a7dd..ee3045967 100644 --- a/app/models/repository/darcs.rb +++ b/app/models/repository/darcs.rb @@ -42,7 +42,11 @@ class Repository::Darcs < Repository end def entries(path=nil, identifier=nil) - patch = identifier.nil? ? nil : changesets.find_by_revision(identifier) + patch = nil + if ! identifier.nil? + patch = changesets.find_by_revision(identifier) + return nil if patch.nil? + end entries = scm.entries(path, patch.nil? ? nil : patch.scmid) if entries entries.each do |entry|