]> source.dussan.org Git - redmine.git/commitdiff
scm: git: explicitly return string as default branch (#10207)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 12 Feb 2012 08:26:31 +0000 (08:26 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 12 Feb 2012 08:26:31 +0000 (08:26 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8857 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/git_adapter.rb

index c7bdbe13cc53cefbd126223fe53aa4ae4cb3062d..44d2be8e0344923d0b204cdd37f80e4aff7b30df 100644 (file)
@@ -111,8 +111,9 @@ module Redmine
           bras = self.branches
           return nil if bras.nil?
           default_bras = bras.select{|x| x.is_default == true}
-          return default_bras.first if ! default_bras.empty?
-          bras.include?('master') ? 'master' : bras.first
+          return default_bras.first.to_s if ! default_bras.empty?
+          master_bras = bras.select{|x| x.to_s == 'master'}
+          master_bras.empty? ? bras.first.to_s : 'master' 
         end
 
         def entry(path=nil, identifier=nil)