Skip to content

Commit af4902b

Browse files
titmhoyer
andauthored
Ruby version compatibility conflict solution (#453)
``` $ ruby --version $ irb -r git ``` This warning call because lines 1055 and 1057 have old Ruby syntax. ``` return str.encode(default_encoding, str.encoding, encoding_options) if str.valid_encoding? ``` @see https://piechowski.io/post/last-arg-keyword-deprecated-ruby-2-7/ Signed-off-by: Marcel Hoyer <mhoyer@pixelplastic.de> Signed-off-by: Sergey Blohin <sblohin@yandex.ru> Co-authored-by: Marcel Hoyer <mhoyer@pixelplastic.de>
1 parent c10ca28 commit af4902b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/git/lib.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,9 +1052,9 @@ def encoding_options
10521052
def normalize_encoding(str)
10531053
return str if str.valid_encoding? && str.encoding == default_encoding
10541054

1055-
return str.encode(default_encoding, str.encoding, encoding_options) if str.valid_encoding?
1055+
return str.encode(default_encoding, str.encoding, **encoding_options) if str.valid_encoding?
10561056

1057-
str.encode(default_encoding, detected_encoding(str), encoding_options)
1057+
str.encode(default_encoding, detected_encoding(str), **encoding_options)
10581058
end
10591059

10601060
def run_command(git_cmd, &block)

0 commit comments

Comments
 (0)