summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-06-30 03:46:32 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-06-30 03:46:32 +0000
commit5cfc42982b9621a62df35162cfbf07051788560c (patch)
tree7f1bf2e1d5f928b2bb0e9a643b5b5413036478c5
parent102a87dd522ead0104cd3ebc8c9abcbeb93b72d5 (diff)
downloadredmine-5cfc42982b9621a62df35162cfbf07051788560c.tar.gz
redmine-5cfc42982b9621a62df35162cfbf07051788560c.zip
scm: return nil at model default_branch and override at git model (#8458, #6713).
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/trunk@6130 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/repository.rb2
-rw-r--r--app/models/repository/git.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index cb0500009..21bf1fb5d 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -119,7 +119,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])