receive-pack: switch global variable 'commands' to a parameter