From: Toshi MARUYAMA Date: Mon, 11 Jul 2011 00:24:22 +0000 (+0000) Subject: Merge(backport) r6130 from trunk (#8777). X-Git-Tag: 1.2.1~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b44044a76accd86bb7620a5eeedee1ce1dd9dc19;p=redmine.git Merge(backport) r6130 from trunk (#8777). scm: return nil at model default_branch and override at git model. Redmine Git and Mercurial adapter support *branches*. Mercurial default branch is *dafault*. But, it is popular to show all revisions on the top page for Mercurial GUI. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@6244 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/repository.rb b/app/models/repository.rb index 009854b20..161d3cc5a 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -117,7 +117,7 @@ class Repository < ActiveRecord::Base end def default_branch - scm.default_branch + nil end def properties(path, identifier=nil) diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index 50d255062..7d96d002c 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -75,6 +75,10 @@ class Repository::Git < Repository scm.tags end + def default_branch + scm.default_branch + end + def find_changeset_by_name(name) return nil if name.nil? || name.empty? e = changesets.find(:first, :conditions => ['revision = ?', name.to_s])