[前][次][番号順一覧][スレッド一覧]

ruby-changes:73959

From: Nobuyoshi <ko1@a...>
Date: Wed, 12 Oct 2022 12:28:03 +0900 (JST)
Subject: [ruby-changes:73959] c67e496886 (master): sync_default_gems: Should match with the beginning of the strings

https://git.ruby-lang.org/ruby.git/commit/?id=c67e496886

From c67e49688642b5a650f53765dd11c1202d1ea57f Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 12 Oct 2022 11:38:44 +0900
Subject: sync_default_gems: Should match with the beginning of the strings

`git status -z` result is NUL-separated, and can contain newline
characters.
---
 tool/sync_default_gems.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 1e8c086dcf..530ec6e7b3 100755
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -478,13 +478,13 @@ def sync_default_gems_with_commits(gem, ranges, edit: nil) https://github.com/ruby/ruby/blob/trunk/tool/sync_default_gems.rb#L478
       skipped = true
     elsif /^CONFLICT/ =~ result
       result = pipe_readlines(%W"git status --porcelain -z")
-      result.map! {|line| line[/^.U (.*)/, 1]}
+      result.map! {|line| line[/\A.U (.*)/, 1]}
       result.compact!
       ignore, conflict = result.partition {|name| IGNORE_FILE_PATTERN =~ name}
       unless ignore.empty?
         system(*%W"git reset HEAD --", *ignore)
         File.unlink(*ignore)
-        ignore = pipe_readlines(%W"git status --porcelain -z" + ignore).map! {|line| line[/^.. (.*)/, 1]}
+        ignore = pipe_readlines(%W"git status --porcelain -z" + ignore).map! {|line| line[/\A.. (.*)/, 1]}
         system(*%W"git checkout HEAD --", *ignore) unless ignore.empty?
       end
       unless conflict.empty?
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]