mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-15 21:39:00 +00:00
Fix 500 error when trying to resolve non-ASCII conflicts in editor
When we added caching, this meant that calling `can_be_resolved_in_ui?` didn't always call `lines`, which meant that we didn't get the benefit of the side-effect from that, where it forced the conflict data itself to UTF-8. To fix that, make this explicit by separating the `raw_content` (any encoding) from the `content` (which is either UTF-8, or an exception is raised).
This commit is contained in:
@ -40,7 +40,10 @@ module Gitlab
|
||||
# when there are no conflict files.
|
||||
files.each(&:lines)
|
||||
files.any?
|
||||
rescue Gitlab::Git::CommandError, Gitlab::Git::Conflict::Parser::UnresolvableError, Gitlab::Git::Conflict::Resolver::ConflictSideMissing
|
||||
rescue Gitlab::Git::CommandError,
|
||||
Gitlab::Git::Conflict::Parser::UnresolvableError,
|
||||
Gitlab::Git::Conflict::Resolver::ConflictSideMissing,
|
||||
Gitlab::Git::Conflict::File::UnsupportedEncoding
|
||||
false
|
||||
end
|
||||
cache_method :can_be_resolved_in_ui?
|
||||
|
Reference in New Issue
Block a user