Properly handle template branch names that contain a forward slash
(cherry picked from commit b3cec03)