deal with different output of "branch" command