1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

vcs.rb: no empty names

* tool/vcs.rb (get_revisions): branch names must not be empty.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-01-17 13:56:28 +00:00
parent 63491598c6
commit ae27382632

View file

@ -135,7 +135,7 @@ class VCS
info_xml = IO.pread(%W"svn info --xml #{path}")
_, last, _, changed, _ = info_xml.split(/revision="(\d+)"/)
modified = info_xml[/<date>([^<>]*)/, 1]
branch = info_xml[%r'<relative-url>\^/(?:branches/|tags/)?([^<>]*)', 1]
branch = info_xml[%r'<relative-url>\^/(?:branches/|tags/)?([^<>]+)', 1]
[last, changed, modified, branch]
end
@ -209,7 +209,7 @@ class VCS
cmd = %W[git]
cmd.push("-C", srcdir) if srcdir
cmd.push("symbolic-ref", "HEAD")
branch = IO.pread(cmd)[%r'\A(?:refs/heads/)?(.*)', 1]
branch = IO.pread(cmd)[%r'\A(?:refs/heads/)?(.+)', 1]
[last, changed, modified, branch]
end