Issue with big repos and branch listings

Hi there:

I'm trying to list all the branches from a big repository (arround 520 branches) but the command never ends.

$repo = $git->open(..path..); $branches = $repo->getBranches();
When there is only one remote, the command works fine.
When using 2 remotes, the command never ends (waited for more than 30 minutes).

I even tried to configure pager.branch => false or cat to avoid less output, but without luck.

Using PHP 7.4