Commit 6538f013 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Fix Ruby 2.5 compatibility for diverging counts of branches

!31480 does not fully restore compatibility because another Ruby 2.6
feature besides `Enumerable#filter` was used in commit ca5cd7b7. The use
of `Enumerable#to_h`'s block is now replaced by an explicit
`Enumerable#map` call.

Error message:

	TypeError (wrong element type Gitlab::Git::Branch at 0 (expected array)):
  	app/controllers/projects/branches_controller.rb:53:in `to_h'


Fixes #64143.
parent 97f9d5f7
......@@ -49,7 +49,7 @@ class Projects::BranchesController < Projects::ApplicationController
branches =, params.permit(names: [])).execute
Gitlab::GitalyClient.allow_n_plus_1_calls do
render json: branches.to_h { |branch| [,] }
render json: { |branch| [,] }.to_h
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment