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.
This commit is contained in:
parent
e496e96547
commit
b4dfac2c12
@ -24,9 +24,9 @@ class Git
|
|||||||
# [0, 1, 4, ...]
|
# [0, 1, 4, ...]
|
||||||
def updated_lines(file)
|
def updated_lines(file)
|
||||||
lines = []
|
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|
|
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
|
lines << index
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user