Branches with special characters are not deleted via GitHub importer
ZD: https://gitlab.zendesk.com/agent/tickets/32481
Dear Gitlab Team,
we are trying to migrate our github repositories to our internal gitlab server. It is working for most of our repos.
I noticed that gitlab restores all branches of closed github PR’s and deletes them after a successful migration. Unfortunately one restored branch has some special character ( ü ) in its name.
This leads to the following error:
irb(main):002:0> p.import_error => "DELETE https://api.github.com/repos/documatrix/dmdoc/git/refs/heads/ma/parameter_f%C3%BCr_user_valid-c79f3c27: 422 - Reference does not exist // See: https://developer.github.com/v3/git/refs/#update-a-reference"
I was able to manually delete that branch (ref), with the command "git push origin -- :ma/parameter_für_user_valid-c79f3c27” (It only works with the "--“ after origin).
Is there a known workaround for this problem?
@dbalexandre, is this a problem with passing UTF-8 data to the GitHub client?
branches.each do |name, _|
client.delete_ref(repo, "heads/#{name}")
project.repository.delete_branch(name) rescue Rugged::ReferenceError
end