From: Toshi MARUYAMA Date: Sun, 12 Feb 2012 08:26:31 +0000 (+0000) Subject: scm: git: explicitly return string as default branch (#10207) X-Git-Tag: 1.4.0~453 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=58996e891ef709385d7f2483ccf4de5ba66507f2;p=redmine.git scm: git: explicitly return string as default branch (#10207) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8857 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index c7bdbe13c..44d2be8e0 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -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)