Test for {repo} before testing for {branch}; this ensures submodules do not get mistaken for branch names