-
Stan Hu authored
When we added caching for protected branch names in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64738, we did not account for UTF-8 characters being used in the branch name. The cache key would be encoded in ASCII-8BIT due to the branch name coming from Gitaly, but when the performance bar were enabled the Redis activity would be dumped to JSON. Since this string wasn't UTF-8, Ruby would throw up a `Encoding::UndefinedConversionError`. This commit fixes the problem by hashing the ref name with SHA-1 to avoid needing to deal with any encoding issues. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/343698 Changelog: fixed
cbbe0349