Skip to content

Git::Lib#normalize_encoding early return fix #461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Git::Lib#normalize_encoding early return fix
`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>
  • Loading branch information
sd-trailhead-james committed Mar 27, 2020
commit 020c8eaa35d2a8ca281d67339ce487e46a4f57b3
2 changes: 1 addition & 1 deletion lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ def encoding_options
end

def normalize_encoding(str)
return str if str.valid_encoding? && str.encoding == default_encoding
return str if str.valid_encoding? && str.encoding.name == default_encoding

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

Expand Down