[#35] abort if no upstream branch is set but --standard-output is set
[Enhancement] Use subshell

Get rid off the bad patter cd somewhere; cd -
Instead use the subshell which runs into another
process, and thus affecting only its state and
not the calling script. Also remove the global
variable branch. Use echo instead.