aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-08-25 12:53:15 -0700
committerJeremy Evans <code@jeremyevans.net>2019-08-25 12:53:15 -0700
commitb4dfac2c125605881239fd62b7f458f52efff7ed (patch)
tree40b2763b7abda50747d35c2aba227f097f92873d /misc
parente496e96547b64c3a2fa6f285c3bc9bd21a245ac6 (diff)
downloadruby-b4dfac2c125605881239fd62b7f458f52efff7ed.tar.gz
Fix ArgumentError in expand_tabs.rb
This fixes the following in my environment: misc/expand_tabs.rb:29:in `=~': invalid byte sequence in US-ASCII (ArgumentError) This switches from =~ to start_with? as a regular expression is not actually needed here.
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/expand_tabs.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc/expand_tabs.rb b/misc/expand_tabs.rb
index c4f6fda1cc..7b3bff78ff 100755
--- a/misc/expand_tabs.rb
+++ b/misc/expand_tabs.rb
@@ -24,9 +24,9 @@ class Git
# [0, 1, 4, ...]
def updated_lines(file)
lines = []
- revs_pattern = /\A0{40} /
+ revs_pattern = ("0"*40) + " "
with_clean_env { IO.popen(['git', 'blame', '-l', '--', file], &:readlines) }.each_with_index do |line, index|
- if revs_pattern =~ line
+ if line.b.start_with?(revs_pattern)
lines << index
end
end