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

tool/vcs.rb: return the commit date as the modified time

This commit is contained in:
Nobuyoshi Nakada 2019-06-04 21:27:46 +09:00
parent 2e2cd8297b
commit 39eae6bf89
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -405,9 +405,9 @@ class VCS
def self.get_revisions(path, srcdir = nil)
gitcmd = [COMMAND, '-C', srcdir || '.']
last = cmd_read_at(srcdir, [[*gitcmd, 'rev-parse', 'HEAD']]).rstrip
log = cmd_read_at(srcdir, [[*gitcmd, 'log', '-n1', '--date=iso', *path]])
log = cmd_read_at(srcdir, [[*gitcmd, 'log', '-n1', '--date=iso', '--pretty=fuller', *path]])
changed = log[/\Acommit (\h+)/, 1]
modified = log[/^Date:\s+(.*)/, 1]
modified = log[/^CommitDate:\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.to_a