Loading
proto: Accept non-UTF-8 revisions in ListCommits
Context
This MR must be understood in the context of the work to deprecate FindCommits RPC.
See epic here: gitlab-org#23203
See here more for context on this change: #6845 (comment 4058666061)
What does this MR do and why?
ListCommitsRequest.revisions is a string field, so it must hold valid UTF-8. Git doesn't require ref names to be UTF-8, so a branch like refs/heads/caf\xE9 can't be passed to ListCommits: clients fail to encode the request and Gitaly refuses to unmarshal it. FindCommits takes bytes, so this blocks migrating its callers to ListCommits and deprecating FindCommits.
This MR changes the field to repeated bytes revisions, like CountCommitsRequest.revisions and CheckObjectsExistRequest.revisions.
- Wire compatible:
stringandbytesshare the same encoding, so existing clients keep working. - Go callers: the generated type changes from
[]stringto[][]byte. - Tests: list commits from a branch named
refs/heads/caf\xE9, both on its own and as an exclusion. On the files backend, the test writes the ref intopacked-refs, because some filesystems (APFS) reject loose-ref filenames that aren't valid UTF-8.
Closes #7543 (closed)
Part of gitlab-org#23203
Edited by Olivier Campeau