branch: split validate_new_branchname() into two