Skip to content

Commit 5391aef

Browse files
Git::Lib#normalize_encoding early return fix (#461)
`Git::Lib#normalize_encoding`: when checking to see if the given string is already in the desired encoding, fix the comparison check to compare string value to string value, not class to string value. Signed-off-by: sd-trailhead-james <james.bunch@salesforce.com> Co-authored-by: James Couball <jcouball@yahoo.com>
1 parent 2b9629d commit 5391aef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/git/lib.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ def encoding_options
10501050
end
10511051

10521052
def normalize_encoding(str)
1053-
return str if str.valid_encoding? && str.encoding == default_encoding
1053+
return str if str.valid_encoding? && str.encoding.name == default_encoding
10541054

10551055
return str.encode(default_encoding, str.encoding, **encoding_options) if str.valid_encoding?
10561056

0 commit comments

Comments
 (0)