German court to rule on custody for ex-Catalan leader