]> source.dussan.org Git - redmine.git/commitdiff
scm: cvs: cat returns nil if revision does not exist at model.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 11 Apr 2011 13:12:37 +0000 (13:12 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 11 Apr 2011 13:12:37 +0000 (13:12 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5408 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/cvs.rb

index 5cec74e5a6949b970ea2ff09e84af39d7708c41b..c8f98852e46364e4bf9e485db6b0be899859dca2 100644 (file)
@@ -65,7 +65,11 @@ class Repository::Cvs < Repository
   end
   
   def cat(path, identifier=nil)
-    rev = identifier.nil? ? nil : changesets.find_by_revision(identifier)
+    rev = nil
+    if ! identifier.nil?
+      rev = changesets.find_by_revision(identifier)
+      return nil if rev.nil?
+    end
     scm.cat(path, rev.nil? ? nil : rev.committed_on)
   end