From f673027bc17ea74444b99be3e5b74a12d9b8edb7 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 10 Jun 2012 18:38:31 +0000 Subject: [PATCH] Code cleanup. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9807 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository/git.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)