Another fix for issues #8

My fix didn't work with branches once they were checked out locally.
Added a check to find out if a branch is already checked out locally and only do cmd.setCreateBranch(true) if not so.