From 58996e891ef709385d7f2483ccf4de5ba66507f2 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 12 Feb 2012 08:26:31 +0000 Subject: [PATCH] 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 --- lib/redmine/scm/adapters/git_adapter.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) -- 2.39.5