summaryrefslogtreecommitdiff
path: root/tool/vcs.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-04 21:27:46 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-04 21:27:46 +0900
commit39eae6bf89773ef830b632c02737545ab9eedd35 (patch)
tree5e2954b28d1cbc3ea61b7b0fbba10855af8bc21e /tool/vcs.rb
parent2e2cd8297bf34dd5f613d5001da54949ba228ca6 (diff)
tool/vcs.rb: return the commit date as the modified time
Diffstat (limited to 'tool/vcs.rb')
-rw-r--r--tool/vcs.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb
index 6c67b9b..8735d08 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -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