Restore merge to branch functionality accidentally removed in 50c4540f9cc9aeb30e1b8bd53fecaff09fe0894f