summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-12 08:26:31 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-12 08:26:31 +0000
commit58996e891ef709385d7f2483ccf4de5ba66507f2 (patch)
treefac39a60bff18686d348d7bb86bce9547eaeeb89 /lib
parent2fa19441a7ffbbc77da403a9a6d7a384756913cb (diff)
downloadredmine-58996e891ef709385d7f2483ccf4de5ba66507f2.tar.gz
redmine-58996e891ef709385d7f2483ccf4de5ba66507f2.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/scm/adapters/git_adapter.rb5
1 files 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)