Browse Source

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
tags/1.3.0
Toshi MARUYAMA 13 years ago
parent
commit
5cfc42982b
2 changed files with 5 additions and 1 deletions
  1. 1
    1
      app/models/repository.rb
  2. 4
    0
      app/models/repository/git.rb

+ 1
- 1
app/models/repository.rb View File

@@ -119,7 +119,7 @@ class Repository < ActiveRecord::Base
end

def default_branch
scm.default_branch
nil
end

def properties(path, identifier=nil)

+ 4
- 0
app/models/repository/git.rb View File

@@ -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])

Loading…
Cancel
Save