Commit cb467e3a authored by Toshi MARUYAMA's avatar Toshi MARUYAMA Committed by Eric Davis

scm: git: implement find_changeset_by_name (#7047).

SQL "like" is slow.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4851 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent f0d4b262
......@@ -47,6 +47,13 @@ class Repository::Git < Repository
scm.tags
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}%"])
end
# With SCM's that have a sequential commit numbering, redmine is able to be
# clever and only fetch changesets going forward from the most recent one
# it knows about. However, with git, you never know if people have merged
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment