Checks if a git repository is already on a specific branch.