scm: git: add model method to get heads from extra_info branches hash (#8857)

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8816 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2012-02-09 00:11:03 +00:00
parent 34b3a9851f
commit 693191e8bf
2 changed files with 23 additions and 0 deletions
+7
View File
@@ -194,6 +194,13 @@ class Repository::Git < Repository
end
private :save_revision
def heads_from_branches_hash
h1 = extra_info || {}
h = h1.dup
h["branches"] ||= {}
h['branches'].map{|br, hs| hs['last_scmid']}
end
def latest_changesets(path,rev,limit=10)
revisions = scm.revisions(path, nil, rev, :limit => limit, :all => false)
return [] if revisions.nil? || revisions.empty?