diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index a9a666c28..064a67494 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -87,10 +87,10 @@ class Repository::Git < Repository end def find_changeset_by_name(name) - return nil if name.nil? || name.empty? - e = changesets.find(:first, :conditions => ['revision = ?', name.to_s]) - return e if e - changesets.find(:first, :conditions => ['scmid LIKE ?', "#{name}%"]) + if name.present? + changesets.where(:revision => name.to_s).first || + changesets.where('scmid LIKE ?', "#{name}%").first + end end def entries(path=nil, identifier=nil)