diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-06-10 18:38:31 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-06-10 18:38:31 +0000 |
commit | f673027bc17ea74444b99be3e5b74a12d9b8edb7 (patch) | |
tree | e4b75f9f149e760b9ab2fda40f498e781c23b3ee /app | |
parent | 8a491dbae94b8fbb4ca4241cba7650c81380e98e (diff) | |
download | redmine-f673027bc17ea74444b99be3e5b74a12d9b8edb7.tar.gz redmine-f673027bc17ea74444b99be3e5b74a12d9b8edb7.zip |
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9807 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository/git.rb | 8 |
1 files 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) |