[Title] fix branch check
authorjiil.hyoun <jiil.hyoun@samsung.com>
Thu, 16 Aug 2012 07:26:54 +0000 (16:26 +0900)
committerjiil.hyoun <jiil.hyoun@samsung.com>
Thu, 16 Aug 2012 07:26:54 +0000 (16:26 +0900)
[Type] Bugfix
[Module] Toolchain /
[Priority] Major
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

src/build_server/GitBuildProject.rb

index 87159ad71b373a36d2e3af31440ca89790665eba..4afdef61998342d0f949280ed7f97c03c9a8c7f4 100644 (file)
@@ -191,7 +191,7 @@ class GitBuildProject < CommonProject
                
                        # check branch name
                        if File.exist? git_path then
-                               current_branch =  git_cmd_return( "branch",  git_path)[0].split(" ")[1].strip
+                               current_branch =  git_cmd_return( "branch",  git_path).select{|x| x.start_with?("*")}[0].split(" ")[1].strip
                                if current_branch != git_branch then
                                        log.warn( "Branch name is changed.", Log::LV_USER)
                                        FileUtils.rm_rf git_path