From: Toshi MARUYAMA Date: Fri, 14 Jan 2011 23:37:10 +0000 (+0000) Subject: Merged r4712 from trunk. X-Git-Tag: 1.1.1~27 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=96c4dc3f1e4ee8f99cc0257a5d5258b60882931c;p=redmine.git Merged r4712 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.1-stable@4715 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/repository.rb b/app/models/repository.rb index 89360393d..19458de87 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -91,13 +91,13 @@ class Repository < ActiveRecord::Base def relative_path(path) path end - + # Finds and returns a revision with a number or the beginning of a hash def find_changeset_by_name(name) - return nil if name.nil? || name.empty? + return nil if name.blank? changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%'])) end - + def latest_changeset @latest_changeset ||= changesets.find(:first) end