support arbitrary meta branch, #8370

Hi,
I've added support for a user-specified meta branch. This removes the hard-coding of `metadata-v2` but still leaves it as the default.

Please let me know any feedback and I will incorporate!