_lp_git_branch: optimize code paths