diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-08-25 12:53:15 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-08-25 12:53:15 -0700 |
commit | b4dfac2c125605881239fd62b7f458f52efff7ed (patch) | |
tree | 40b2763b7abda50747d35c2aba227f097f92873d /misc/expand_tabs.rb | |
parent | e496e96547b64c3a2fa6f285c3bc9bd21a245ac6 (diff) |
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/expand_tabs.rb')
-rwxr-xr-x | misc/expand_tabs.rb | 4 |
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 |