How about calling ensure_current_master unless we're not on a non-master branch (i.e., if we're on either master or on a detached head, as Jenkins does)? This way, a user pushing their own branch wouldn't be affected. But if it's CI/Jenkins or already on master, it would checkout master and pull from origin master.