remote.c: refactor setup of branch->merge list