From f3f1a666c77f8c528b0adc9ccf78e4b9910bd6e0 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 21 Jan 2021 21:49:00 +0900 Subject: [ruby/rdoc] Shorten commit hashes https://github.com/ruby/rdoc/commit/5d3e153963 --- lib/rdoc/parser/changelog.rb | 2 +- test/rdoc/test_rdoc_parser_changelog.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rdoc/parser/changelog.rb b/lib/rdoc/parser/changelog.rb index eca4b56ec9..d0701a6772 100644 --- a/lib/rdoc/parser/changelog.rb +++ b/lib/rdoc/parser/changelog.rb @@ -211,7 +211,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser def parse_entries entries = [] - @content.scan(/^commit\s+(\h+)\n *Author: *(.+)\n *Date: *(.+)\n\n((?: {4}.*\n+)*)/) do + @content.scan(/^commit\s+(\h{20})\h*\n *Author: *(.+)\n *Date: *(.+)\n\n((?: {4}.*\n+)*)/) do entry_name, author, date, entry_body = $1, $2, $3, $4.gsub(/^ {4}/, '') if /(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+) *([-+]\d\d)(\d\d)/ =~ date time = Time.new($1, $2, $3, $4, $5, $6, "#{$7}:#{$8}") diff --git a/test/rdoc/test_rdoc_parser_changelog.rb b/test/rdoc/test_rdoc_parser_changelog.rb index 5f43811c03..e1fd459249 100644 --- a/test/rdoc/test_rdoc_parser_changelog.rb +++ b/test/rdoc/test_rdoc_parser_changelog.rb @@ -280,7 +280,7 @@ commit\ 709bed2afaee50e2ce803f87bf1ee8291bea41e3 ChangeLog expected = [ - [ "709bed2afaee50e2ce803f87bf1ee8291bea41e3", + [ "709bed2afaee50e2ce80", [ "git ", "2021-01-21 01:03:52 +0900", "* 2021-01-21 [ci skip]\n"]]] -- cgit v1.2.3