Fix encoding error in DetectRepositoryLanguagesWorker

What does this MR do and why?

Contributes to #566590 (closed)

Problem

DetectRepositoryLanguagesWorker crashes with Encoding::UndefinedConversionError when processing references containing Unicode characters.

The error occurs during UTF-8 to ASCII-8BIT conversion in commit_service.rb:400, preventing language detection for affected repositories.

Solution

Apply encode_binary() to the revision parameter before passing it to Gitaly::CommitLanguagesRequest. This ensures proper encoding handling and prevents conversion errors when branch names contain non-ASCII characters.

References

https://gitlab.com/gitlab-org/gitlab/-/issues//566590+

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #566590 (closed)

Edited by Vasilii Iakliushin

Merge request reports

Loading