summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-21 21:49:00 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-24 16:46:21 +0900
commitf3f1a666c77f8c528b0adc9ccf78e4b9910bd6e0 (patch)
tree87df6489616f1bfcbd3fd63489d3f0d8c834d332
parent127f735c1e5e0771076caf2a74390757a42fb177 (diff)
[ruby/rdoc] Shorten commit hashes
https://github.com/ruby/rdoc/commit/5d3e153963
-rw-r--r--lib/rdoc/parser/changelog.rb2
-rw-r--r--test/rdoc/test_rdoc_parser_changelog.rb2
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 <svn-admin@ruby-lang.org>",
"2021-01-21 01:03:52 +0900",
"* 2021-01-21 [ci skip]\n"]]]