summaryrefslogtreecommitdiff
path: root/tool/sync_default_gems.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2023-07-12 23:27:30 +0900
committerKazuki Yamaguchi <k@rhe.jp>2023-07-12 23:40:12 +0900
commitfb12522b009b0cf331d6cbbe3cc5c0f48381d57e (patch)
tree865b84b5ec1610b233bdd89594320707d4652f27 /tool/sync_default_gems.rb
parent4fced7860535c650aa20c10cc59c053943aeeb3d (diff)
sync_default_gems.rb: ensure that commit messages end with \n
Commit messages written on GitHub's Web UI apparently use \r\n as a line separator and do not have a \n at the end of message, unlike those normally made with the git CLI. This breaks the expectation of the regexps used later.
Diffstat (limited to 'tool/sync_default_gems.rb')
-rwxr-xr-xtool/sync_default_gems.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 17b3ed5177..e5dec18222 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -443,6 +443,7 @@ module SyncDefaultGems
def message_filter(repo, sha, input: ARGF)
log = input.read
log.delete!("\r")
+ log << "\n" if !log.end_with?("\n")
repo_url = "https://github.com/#{repo}"
subject, log = log.split(/\n(?:[ \t]*(?:\n|\z))/, 2)
conv = proc do |s|