corrected the current branch getting code

could have used the zsh current_branch function but want to keep this
cross platfom