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

vcs.rb: fix GIT.get_revisions

* tool/vcs.rb (VCS::GIT.get_revisions): fix for out-of-place
  build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-11-08 10:44:21 +00:00
parent a4e0e75881
commit eb8ae3bdda

View file

@ -343,20 +343,20 @@ class VCS
logcmd = gitcmd + %W[log -n1 --date=iso]
logcmd << "--grep=^ *git-svn-id: .*@[0-9][0-9]*"
idpat = /git-svn-id: .*?@(\d+) \S+\Z/
log = IO.pread(logcmd)
log = cmd_read_at(srcdir, [logcmd])
commit = log[/\Acommit (\w+)/, 1]
last = log[idpat, 1]
if path
cmd = logcmd
cmd += [path] unless path == '.'
log = IO.pread(cmd)
log = cmd_read_at(srcdir, [cmd])
changed = log[idpat, 1]
else
changed = last
end
modified = log[/^Date:\s+(.*)/, 1]
branch = IO.pread(gitcmd + %W[symbolic-ref HEAD])[%r'\A(?:refs/heads/)?(.+)', 1]
title = IO.pread(gitcmd + %W[log --format=%s -n1 #{commit}..HEAD])
branch = cmd_read_at(srcdir, [gitcmd + %W[symbolic-ref HEAD]])[%r'\A(?:refs/heads/)?(.+)', 1]
title = cmd_read_at(srcdir, [gitcmd + %W[log --format=%s -n1 #{commit}..HEAD]])
title = nil if title.empty?
[last, changed, modified, branch, title]
end