Skip to content

Change `commits_by_message` to not mutate string arguments

The following discussion from !33216 (merged) should be addressed:

  • @ali-gitlab started a discussion: (+2 comments)

    + is used here to unfreeze the string literal. Without this, the test fails with:

    FrozenError: can't modify frozen String
    
      0) Gitlab::ProjectSearchResults commit search by commit message when repository_ref is provided filters the search by ref
         Failure/Error: revision: revision.to_s.force_encoding(Encoding::ASCII_8BIT),
    
         FrozenError:
           can't modify frozen String
         # ./lib/gitlab/gitaly_client/commit_service.rb:249:in `force_encoding'
         # ./lib/gitlab/gitaly_client/commit_service.rb:249:in `commits_by_message'
Edited by Alishan Ladhani