Code cleanup.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9807 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-06-10 18:38:31 +00:00
parent 8a491dbae9
commit f673027bc1
1 changed files with 4 additions and 4 deletions

View File

@ -87,10 +87,10 @@ class Repository::Git < Repository
end end
def find_changeset_by_name(name) def find_changeset_by_name(name)
return nil if name.nil? || name.empty? if name.present?
e = changesets.find(:first, :conditions => ['revision = ?', name.to_s]) changesets.where(:revision => name.to_s).first ||
return e if e changesets.where('scmid LIKE ?', "#{name}%").first
changesets.find(:first, :conditions => ['scmid LIKE ?', "#{name}%"]) end
end end
def entries(path=nil, identifier=nil) def entries(path=nil, identifier=nil)