Loop doing nothing if no branch is checked out