Use subshell

Get rid off the bad pattern cd somewhere; cd -
Instead, use the subshell which runs into another
process, and thus affects only its state and
not the calling script. Also remove the global
variable branch. Use echo instead.
@ihommani l'indent me semble toute pétée dans ce commit.

(rappel : on est sur une indent de 4 espaces)