From cc6fe1524122ba7d890129c7fdbfd28edba198bf Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sun, 25 Aug 2019 16:59:45 +0900 Subject: tool/lib/vcs.rb: explicitly fail when notes/commits is not available --- tool/lib/vcs.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tool') diff --git a/tool/lib/vcs.rb b/tool/lib/vcs.rb index 4684b57b28..a55b5815b4 100644 --- a/tool/lib/vcs.rb +++ b/tool/lib/vcs.rb @@ -567,6 +567,11 @@ class VCS warn "no starting commit found", uplevel: 1 from = nil end + _rev = cmd_read({'LANG' => 'C', 'LC_ALL' => 'C'}, + %W"#{COMMAND} show-ref notes/commits") + unless $?.success? + raise "need notes/commits tree; run `git fetch origin refs/notes/commits:refs/notes/commits` in the repository" + end range = [from, (to || 'HEAD')].compact.join('^..') cmd_pipe({'TZ' => 'JST-9', 'LANG' => 'C', 'LC_ALL' => 'C'}, %W"#{COMMAND} log --format=medium --notes=commits --date=iso-local --topo-order #{range}", "rb") do |r| -- cgit v1.2.3