Skip to content

Commit

Permalink
Shorten commit hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jan 22, 2021
1 parent 5074c13 commit 5d3e153
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rdoc/parser/changelog.rb
Expand Up @@ -211,7 +211,7 @@ module Git
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}")
Expand Down
2 changes: 1 addition & 1 deletion test/rdoc/test_rdoc_parser_changelog.rb
Expand Up @@ -280,7 +280,7 @@ def test_parse_entries_git
ChangeLog

expected = [
[ "709bed2afaee50e2ce803f87bf1ee8291bea41e3",
[ "709bed2afaee50e2ce80",
[ "git <svn-admin@ruby-lang.org>",
"2021-01-21 01:03:52 +0900",
"* 2021-01-21 [ci skip]\n"]]]
Expand Down

0 comments on commit 5d3e153

Please sign in to comment.