]> source.dussan.org Git - redmine.git/commitdiff
Garbage lines in the output of 'git branch' break git adapter (#31120).
authorGo MAEDA <maeda@farend.jp>
Sun, 7 Apr 2019 07:02:08 +0000 (07:02 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 7 Apr 2019 07:02:08 +0000 (07:02 +0000)
Contributed by Chad Petersen.

git-svn-id: http://svn.redmine.org/redmine/trunk@18046 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/git_adapter.rb

index 339a4e9398858bdd60e59c0e38cbddad0e19a880..c8e5629e6219f8bb434af47010a76407f7dba853 100644 (file)
@@ -84,6 +84,7 @@ module Redmine
           git_cmd(cmd_args) do |io|
             io.each_line do |line|
               branch_rev = line.match('\s*(\*?)\s*(.*?)\s*([0-9a-f]{40}).*$')
+              next unless branch_rev
               bran = GitBranch.new(scm_iconv('UTF-8', @path_encoding, branch_rev[2]))
               bran.revision =  branch_rev[3]
               bran.scmid    =  branch_rev[3]