mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Convert Enumerator to Array for Ruby 1.9.3
String#lines seems to return Enumerator in Ruby 1.9.3, and it does not respond to #delete_if https://travis-ci.org/ruby/ruby/jobs/538559919
This commit is contained in:
parent
5379ca9250
commit
1a0c3d8dd6
1 changed files with 1 additions and 1 deletions
|
@ -407,7 +407,7 @@ class VCS
|
|||
modified = log[/^Date:\s+(.*)/, 1]
|
||||
branch = cmd_read_at(srcdir, [gitcmd + %W[symbolic-ref --short HEAD]])
|
||||
if branch.empty?
|
||||
branch_list = cmd_read_at(srcdir, [gitcmd + %W[branch --list --contains HEAD]]).lines
|
||||
branch_list = cmd_read_at(srcdir, [gitcmd + %W[branch --list --contains HEAD]]).lines.to_a
|
||||
branch_list.delete_if {|b| /detached at/ =~ b}
|
||||
(branch = branch_list[0]).strip! unless branch_list.empty?
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue