securing the sed regex
other optimisation in _lp_git_branch_color