Skip to content
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

Handle encoding uniformly #21

Open
dometto opened this issue Nov 19, 2016 · 0 comments
Open

Handle encoding uniformly #21

dometto opened this issue Nov 19, 2016 · 0 comments

Comments

@dometto
Copy link
Member

dometto commented Nov 19, 2016

As per #19, we need to think about a way to handle the following encoding statements uniformly:

$ grep -r "force_encoding" lib/
lib//rugged_adapter/git_layer_rugged.rb:          files << [patch.delta.new_file[:path].force_encoding("UTF-8"), new_deletions, new_additions, patch.changes] # Rugged seems to generate the stat diffs in the other direciton than grit does by default, so switch the order of additions and deletions.
lib//rugged_adapter/git_layer_rugged.rb:            next unless line.force_encoding("UTF-8").match(/#{Regexp.escape(query)}/i)
lib//rugged_adapter/git_layer_rugged.rb:        patches.map  {|patch| OpenStruct.new(:diff => patch.to_s.split("\n")[2..-1].join("\n").force_encoding("UTF-8"))}.reverse # First remove two superfluous lines. Rugged seems to order the diffs differently than Grit, so reverse.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant