lib/origen/revision_control/git.rb in origen-0.5.8 vs lib/origen/revision_control/git.rb in origen-0.5.9

- old
+ new

@@ -236,10 +236,13 @@ if github? rem = remote_without_protocol else rem = remote end - !git("ls-remote --heads #{rem} #{str}", verbose: false).empty? + # check if matches 40 digit hex string followed by branch name + git("ls-remote --heads #{remote} #{str}", verbose: false).any? do |line| + line =~ /^[0-9a-f]{40}\s+[a-zA-Z]/ + end end def initialized? File.exist?("#{local}/.git") && git('remote -v', verbose: false).any? { |r| r =~ /#{remote_without_protocol_and_user}/ || r =~ /#{remote_without_protocol_and_user.to_s.gsub(':', "\/")}/ } &&